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?
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.
Thanks Hristo for replying.
I had already added the specified line. My problem is that I don't want to display dropdown on all rows. Currently on all rows dropdown is displayed. But I want to display dropdown only on new rows which are created on Add button click.