We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Binding value to DropDownList ItemTemplate in GridGroupingCOntrol

Thread ID:

Created:

Updated:

Platform:

Replies:

107520 Mar 6,2013 07:34 AM UTC Mar 11,2013 04:05 AM UTC ASP.NET Web Forms (Classic) 1
loading
Tags: GridGroupingControl
Administrator [Syncfusion]
Asked On March 6, 2013 07:34 AM UTC

Hello 
I'm new user of SyncFusion GridGroupingControl and maybe my problem stems from insufficient knowledge :-) But I still can't find solution :-(
My situation is:
I have IList<T> as a DataSource of my GGC. In aspx file I set TableDescriptor like this:

<TableDescriptor AllowEdit="false" AllowNew="false" >
                        <Columns>
                            <Syncfusion:GridColumnDescriptor Name="Imie" MappingName="Imie" HeaderText="Imie" Width="50">
                                <GroupByOptions AllowExpressionFilter="False" FilterStatusBarWidth="450" 
                                    ShowFilterStatusMessage="False" />
                            </Syncfusion:GridColumnDescriptor>
                            <Syncfusion:GridColumnDescriptor Name="Nazwisko" MappingName="Nazwisko" HeaderText="Nazwisko" Width="80">
                                <GroupByOptions AllowExpressionFilter="False" FilterStatusBarWidth="450" 
                                    ShowFilterStatusMessage="False" />
                            </Syncfusion:GridColumnDescriptor>
                            <Syncfusion:GridColumnDescriptor Name="Wiek" MappingName="Wiek" HeaderText="Wiek" Width="30">
                                <GroupByOptions AllowExpressionFilter="False" FilterStatusBarWidth="450" 
                                    ShowFilterStatusMessage="False" />
                            </Syncfusion:GridColumnDescriptor>
                            <Syncfusion:GridColumnDescriptor Name="Ilosc_H" MappingName="Ilosc_H" HeaderText="Ilość godz." Width="40">
                                <Appearance>
                                    <AnyRecordFieldCell CellType="TextBox" />
                                </Appearance>
                                <GroupByOptions AllowExpressionFilter="False" FilterStatusBarWidth="450" 
                                    ShowFilterStatusMessage="False" />
                            </Syncfusion:GridColumnDescriptor>
                            <Syncfusion:GridColumnDescriptor Name="Ilosc" MappingName="Ilosc" HeaderText="Ilość abs." Width="40">
                                <Appearance>
                                    <AnyRecordFieldCell CellType="TextBox" />
                                </Appearance>
                                <GroupByOptions AllowExpressionFilter="False" FilterStatusBarWidth="450" 
                                    ShowFilterStatusMessage="False" />
                            </Syncfusion:GridColumnDescriptor>
                            <Syncfusion:GridColumnDescriptor Name="Symbol" MappingName="Symbol" HeaderText="Powód" Width="40">
                                <ItemTemplate>
                                    <asp:DropDownList ID="DropDownList1" runat="server" 
                                        OnSelectedIndexChanged="ddl_SelectedIndexChanged" 
                                        ontextchanged="DropDownList1_TextChanged">
                                        <asp:ListItem>" "</asp:ListItem>
                                        <asp:ListItem>A</asp:ListItem>
                                        <asp:ListItem>B</asp:ListItem>
                                        <asp:ListItem>C</asp:ListItem>
                                        <asp:ListItem>D</asp:ListItem>
                                        <asp:ListItem>E</asp:ListItem>
                                    </asp:DropDownList>
                                </ItemTemplate>
                                <Appearance>
                                    <AnyRecordFieldCell CellType="ComboBox" />
                                </Appearance>
                                <GroupByOptions AllowExpressionFilter="False" FilterStatusBarWidth="450" 
                                    ShowFilterStatusMessage="False" />
                            </Syncfusion:GridColumnDescriptor>
                                                        
                        </Columns>
                     
                        <ChildGroupOptions AllowExpressionFilter="False" FilterStatusBarWidth="450" 
                            ShowFilterStatusMessage="False" />
                        <TopLevelGroupOptions AllowExpressionFilter="False" FilterStatusBarWidth="450" 
                            ShowFilterStatusMessage="False" />
                    </TableDescriptor>
I use code like in http://asp.syncfusion.com/demos/ui/gridgrouping/CRUD%20Operations/ExcelLikeEdit/cs/ExcelLikeEdit.aspx with some changes. I set Paging. When I set values in few rows and change page, all changed values remain except value of DropDownList in column Symbol. I thought that setting MappingName is sufficient to bind and save the value. What should I do to set it and do not lose it when I change page.
Plase help.
Regards
Kate.



Ranjithkumar R G [Syncfusion]
Replied On March 11, 2013 04:05 AM UTC

Hi Kate,

 

Thanks for using Syncfusion products.

 

We suggest you to  handle QueryCellStyleInfo event to bind dropdown list items for Excel like Edit. Please refer to the code snippet below.

 

[CS]

 

  protected void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)

    {

        if (e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell || e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)

        {

            if (e.TableCellIdentity.Column.Name == "Title")

            {

                ArrayList array = new ArrayList();

                array.Add("Sales Representative");

                array.Add("Vice President, Sales");

                array.Add("Inside Sales Coordinator");

                array.Add("Business Manager");

                array.Add("Mail Clerk");

                array.Add("Receptionist");

                e.Style.DataSource = array;

            }

        }

    }

 

Please let us know if you have any concern.

 

Regards,

Ranjithkumar


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;