Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1230
Display UnboundField Dropdown on some rows
posted

In WebDataGrid column, I had used UnBoundField for displaying Dropdown. On Add button(which is placed outside grid) click, I want to display dropdown in unbounded field, otherwise this unbounded field will display already saved text(ie no dropdown in grid.)

Below is the code I am using to display dropdown

<ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="400px"
        Width="100%" AutoGenerateColumns="false" DataKeyFields="ID" >
<Columns>

  <ig:UnboundField Key="Name" Width="350px" Header Text="Name" /> </ig:UnboundField>
.......
 <Columns>
<EditorProviders> <ig:DropDownProvider ID="NameProvider"> <EditorControl ID="editName" runat="server" DisplayMode="DropDownList" TextField="SName" ValueField="SName" /> </ig:DropDownProvider>
</EditorProviders>

<Behaviors> <ig:EditingCore> <Behaviors> <ig:CellEditing Enabled="true"> <ColumnSettings> <ig:EditingColumnSetting ColumnKey="Name" EditorID="NameProvider" />

</ColumnSettings> </ig:CellEditing> </Behaviors> </ig:EditingCore> </Behaviors>
</ig:WebDataGrid>
<asp:Button Id="btnAdd" runat="server" Text="Add Name" onclick="btnAdd_Click"/>

What's the best way to show dropdown in some rows on unboundedField?
Parents
No Data
Reply
  • 16310
    Offline posted

    Hi,

    Thank you for the markup shared. The best way to display any editor (including DropDown) in any WebDataGrid column is defining the editor as you have did and use the corresponding behavior column settings to set it as editor for a given column:

    <ig:EditingColumnSetting ColumnKey="Name" EditorID="NameProvider" />

    It does not matter that the given column is UnboundField. Please let me know if you have further questions on the matter.

Children