Download DLL only

Mar 9, 2013 at 4:20 PM
Hi,

I'm really interested by this project but unfortunately I'm not able to install it with ClickOnce because I've not Interop DLL 12 but 14.

Is it possible to post only a ZIP archive with DLL ?

Thank you
Coordinator
Mar 11, 2013 at 7:14 PM
Mar 13, 2013 at 2:20 PM
I just can say …Wouaaa it's closer of DevExpress XtraGrid.

Thank for this great job.
Coordinator
Mar 13, 2013 at 4:31 PM
Thanks a lot
Nov 15, 2013 at 7:49 AM
Edited Nov 15, 2013 at 8:30 AM
Hi bPoojary,

I really appriciate the great work done.
I have to choose between devexpress wpf grid suite and your wpfextendeddatagrid. My requirement which doesn't seems to fullfill with normal wpf datagrid is giving collapse/expand button for master detail table and export to excel with formatting the master detail tables. Your solution seems to provide me both the option.
My applciation is in .net 4.0 with OS windwos 7. So far my understanding is, if i just include the dlls "ExtendedGrid.dll", "Fluent.dll", "Imagepacker.dll", "Microsoft.office.Interop.Excel.dll" and office.dll" from WPFControlKit in my project then i should be able to run it successfully.
(1)I tried nested grid but it doesn't seem to work properly and when i am exporting it to scv it's result almost same as wpf datgrid. Can you please provide me a sample applciation which has the exmaple of nested grid with export to excel functionality with same formatting like set for the grid atleast header color etc..
(2)If i create the EntendedGridControl dynamically then would it provide me good performance, records may exceed upto thousand. I might require to load such 15-20 tables dynamically based on conditions i like to set the datasource for it?

It would be great if you can reply me, atleast let me know if this(nested grid, export of nested grid with formatting) is possible to achieve using WPFExtendedDataGrid so that i can decide and meet my deadlines. Keenly looking forward for your reply.

Thanks in advance.
Nov 15, 2013 at 7:51 AM
From where can i get the demo application(WpfControlKit.application) code?
Coordinator
Nov 16, 2013 at 5:46 PM
Hi,

Include "ExtendedGrid.dll",, "Microsoft.office.Interop.Excel.dll" and office.dll" only, rest nor required it was only from Demo.

Can you explain or share application of nested grid with me, and what data you expect in csv?

You can generate EntendedGridControl dynamically, if you requirement is such that, I don't see performance hit unless not properly implemented.

You can download demo application by clicking big download button on home page.
https://wpfextendeddatagrid.codeplex.com/downloads/get/755134

Regards,
bpoojary
Nov 18, 2013 at 6:34 AM
Hi,

Thanks for the reply.

Nested grid i mean grid with parent child relationship.

We just set the grid datasource with following collection.

Lis<ModuleGroupInfo> ModulesGroupInfo = new List<ModuleGroupInfo>();
...................................Set Data................
gd.DataSource = ModulesGroupInfo;
public class ModuleGroupInfo
{
    public string Tag { get; set; }
    public List<ModuleGroups> Groups { get; set; }
}

public class ModuleGroups
{
    public int GrpNo { get; set; }
    public string GrpName { get; set; }
}
I can attach few screen shots but i can't see the attachement option, can i do it by email to you.
Nov 18, 2013 at 6:36 AM

Hi,

Thanks for the reply.


Nested grid i mean grid with parent child relationship.


We just set the grid datasource with following collection.


List<ModuleGroupInfo> ModulesGroupInfo = new List<ModuleGroupInfo>();
...................................Set Data................
gd.DataSource = ModulesGroupInfo;

public class ModuleGroupInfo
{
public string Tag { get; set; }
public List<ModuleGroups> Groups { get; set; }
}

public class ModuleGroups
{
public int GrpNo { get; set; }
public string GrpName { get; set; }
}

I can attach few screen shots but i can't see the attachement option, can i do it by email to you.
(See attached file: Exported Nested Grid.png)(See attached file: Nested Grid.png)

Best Regards

Inactive hide details for "bpoojary" ---16-11-2013 23:16:27---From: bpoojary Hi,

Coordinator
Nov 18, 2013 at 7:26 AM
Hi,

You can use contact user, and send me links to your images.

Regards,
bpoojary
Nov 18, 2013 at 7:34 AM
Edited Nov 18, 2013 at 7:44 AM
Although i have sent that to you via email but I just checked that attachments would be remove from email.
i am finding how to send you the image link....will send you in shortly..
Coordinator
Nov 18, 2013 at 7:47 AM
There are many websites which will help you.
Like imageshack etc etc.
Nov 18, 2013 at 7:55 AM
Edited Nov 18, 2013 at 7:55 AM
Image
Image

Please check f you are able to see the images
Coordinator
Nov 18, 2013 at 7:58 AM
Got it...
I will try and get back to you.
Nov 18, 2013 at 8:00 AM
Edited Nov 18, 2013 at 8:05 AM
Fine, I really appreciate your prompt responces...
Thanks!

Please note the screen shot of nested grid just has one column in parent table but it can have multiple columns.
Coordinator
Nov 18, 2013 at 8:44 AM
Hi,

I achieved it.

WPF Code:
<ExtendedGridControl:ExtendedDataGrid x:Name="grid"  ItemsSource="{Binding Data}" SelectedIndex="0"
            AutoGenerateColumns="False" IsReadOnly="True"  CanUserAddRows="False" CanUserDeleteRows="False" GroupByControlVisibility="Collapsed">
            <ExtendedGridControl:ExtendedDataGrid.Columns>
                <ExtendedColumn:ExtendedDataGridTextColumn Header="Tag" Binding="{Binding Tag}" Width="*"/>
            </ExtendedGridControl:ExtendedDataGrid.Columns>
            <ExtendedGridControl:ExtendedDataGrid.RowDetailsTemplate>
                <DataTemplate>
                    <DataGrid ItemsSource="{Binding Groups}"
                        AutoGenerateColumns="False" IsReadOnly="True"  CanUserAddRows="False" CanUserDeleteRows="False">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="Group Number" Binding="{Binding GrpNo}"/>
                        <DataGridTextColumn Header="Group Name" Binding="{Binding GrpName}"/>
                        </DataGrid.Columns>
                    </DataGrid>
                </DataTemplate>
                </ExtendedGridControl:ExtendedDataGrid.RowDetailsTemplate>
        </ExtendedGridControl:ExtendedDataGrid>
C# Code
 public partial class MainWindow : Window,INotifyPropertyChanged
    {
        public MainWindow()
        {
            
            InitializeComponent();
            this.DataContext = this;
            Data=new ObservableCollection<ModuleGroupInfo>
                     {
                         new ModuleGroupInfo()
                             {
                                 Tag = "123443",
                                 Groups =
                                     new ObservableCollection<ModuleGroups>()
                                         {
                                             new ModuleGroups() {GrpNo = 1, GrpName = "bpoojary"},
                                             new ModuleGroups() {GrpNo = 2, GrpName = "test"}
                                         }
                             },
                         new ModuleGroupInfo()
                             {
                                 Tag = "123443",
                                 Groups =
                                     new ObservableCollection<ModuleGroups>()
                                         {
                                             new ModuleGroups() {GrpNo = 3, GrpName = "mydream"},
                                             new ModuleGroups() {GrpNo = 4, GrpName = "physics"}
                                         }
                             }
                     };
        }

        public ObservableCollection<ModuleGroupInfo> Data { get; set; }
        public event PropertyChangedEventHandler PropertyChanged;
    }
    public class ModuleGroupInfo
    {
        public string Tag { get; set; }
        public ObservableCollection<ModuleGroups> Groups { get; set; }
    }
    public class ModuleGroups
    {
        public int GrpNo { get; set; }
        public string GrpName { get; set; }
    }
Screen shot:

Image

Let me know if you any help, this should give you good idea.

Regards,
bpoojary
Nov 18, 2013 at 8:48 AM
Hi it seems to achieve my purpose, i will just try to implement it at my end.
I hope i should be able toe export it as well
Coordinator
Nov 18, 2013 at 8:56 AM
Hi,

It will copy by deafult only parent grid data, if you want your child data as well you will have to write your own implementation for it.
Which is not that difficult , you need to play with interop.

Regards,
bpoojary
Nov 18, 2013 at 9:05 AM
Hi,

I am able to do the above using WPF normal grid as well the struggling point there was showing the collapse/expand button....and Export to excel the nested table.
I know that code can be written to export the child data as well but i was looking if it was provided just by calling some function.

Thanks for your reply. Your efforts are well appriciated
Coordinator
Nov 18, 2013 at 9:05 AM
I will try to help you out with export as well, let me try.

Regards,
bpoojary
Coordinator
Nov 18, 2013 at 9:15 AM
I will try to find generic solution to your problem, it might take time.
Coordinator
Nov 18, 2013 at 9:20 AM
Do you want me to work on this?
Coordinator
Nov 18, 2013 at 9:22 AM
Simplest solution I can think of , you make ExtendedDatagrid as bases class and override this method.

/// <summary>
    /// This virtual method is called when ApplicationCommands.Copy command is executed.
    /// </summary>
    /// <param name="args"></param>
    protected virtual void OnExecutedCopy(ExecutedRoutedEventArgs args)
    {
        if (ClipboardCopyMode == DataGridClipboardCopyMode.None)
        {
            throw new NotSupportedException(SR.Get(SRID.ClipboardCopyMode_Disabled));
        }

        args.Handled = true;

        // Supported default formats: Html, Text, UnicodeText and CSV
        Collection<string> formats = new Collection<string>(new string[] { DataFormats.Html, DataFormats.Text, DataFormats.UnicodeText, DataFormats.CommaSeparatedValue });
        Dictionary<string, StringBuilder> dataGridStringBuilders = new Dictionary<string, StringBuilder>(formats.Count);
        foreach (string format in formats)
        {
            dataGridStringBuilders[format] = new StringBuilder();
        }

        int minRowIndex;
        int maxRowIndex;
        int minColumnDisplayIndex;
        int maxColumnDisplayIndex;

        // Get the bounding box of the selected cells
        if (_selectedCells.GetSelectionRange(out minColumnDisplayIndex, out maxColumnDisplayIndex, out minRowIndex, out maxRowIndex))
        {
            // Add column headers if enabled
            if (ClipboardCopyMode == DataGridClipboardCopyMode.IncludeHeader)
            {
                DataGridRowClipboardEventArgs preparingRowClipboardContentEventArgs = new DataGridRowClipboardEventArgs(null, minColumnDisplayIndex, maxColumnDisplayIndex, true /*IsColumnHeadersRow*/);
                OnCopyingRowClipboardContent(preparingRowClipboardContentEventArgs);

                foreach (string format in formats)
                {
                    dataGridStringBuilders[format].Append(preparingRowClipboardContentEventArgs.FormatClipboardCellValues(format));
                }
            }

            // Add each selected row
            for (int i = minRowIndex; i <= maxRowIndex; i++)
            {
                object row = Items[i];

                // Row has a selecion
                if (_selectedCells.Intersects(i)) 
                {
                    DataGridRowClipboardEventArgs preparingRowClipboardContentEventArgs = new DataGridRowClipboardEventArgs(row, minColumnDisplayIndex, maxColumnDisplayIndex, false /*IsColumnHeadersRow*/, i);
                    OnCopyingRowClipboardContent(preparingRowClipboardContentEventArgs);

                    foreach (string format in formats)
                    {
                        dataGridStringBuilders[format].Append(preparingRowClipboardContentEventArgs.FormatClipboardCellValues(format));
                    }
                }
            }
        }

        ClipboardHelper.GetClipboardContentForHtml(dataGridStringBuilders[DataFormats.Html]);

        try
        {
            DataObject dataObject = new DataObject();
            foreach (string format in formats)
            {
                dataObject.SetData(format, dataGridStringBuilders[format].ToString(), false /*autoConvert*/);
            }

            Clipboard.SetDataObject(dataObject);
        }
        catch (SecurityException)
        {
            // In partial trust we will have a security exception because clipboard operations require elevated permissions
            // Bug: Once the security team fix Clipboard.SetText - we can remove this catch
            // Temp: Use TextBox.Copy to have at least Text format in the clipboard
            TextBox textBox = new TextBox();
            textBox.Text = dataGridStringBuilders[DataFormats.Text].ToString();
            textBox.SelectAll();
            textBox.Copy();
        }
    }
Or tweak this method is extended datagrid (Not a good idea if not generic solution)

Regards,
bpoojary
Nov 18, 2013 at 9:49 AM
hmm...I also tried something similar but the nest point is achieving the formatting like i sent you in screen shot.
I am looking into it.
Coordinator
Nov 18, 2013 at 12:45 PM
I have done this 2 years back in excel (with the ex pander in excel sheet too)
Coordinator
Nov 18, 2013 at 12:49 PM
Hi,

I got an idea will post in 5 mins.
Coordinator
Nov 18, 2013 at 1:05 PM
Hi,

Create your excel sheet like this

Image

Use interop and run this vba script correspodning C# code
Selection.Rows.Group()
Coordinator
Nov 18, 2013 at 1:20 PM
Did you like the idea?
If you liked we can build a method which takes your data instead of the grid.

Regards,
bpoojary
Nov 19, 2013 at 5:06 AM
Hey, great!

Please give me some time, will get back to you after finishing my current work.
Nov 19, 2013 at 5:54 AM
Yes, your idea is nice.
I can start work on it, will let you know if i would require your more suggestions.
Thanks!