BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
Hi Artur,
Thanks for using Syncfusion Products.
We have achieved your requirement by using the DataSource property in Grid columns. Please find the sample and the code snippet.
Sample: 118480-dropdown.zip
[Default]
<ej:Grid ID="OrdersGrid" runat="server" AllowPaging="True" > <Columns> <ej:Column Field="OrderID" HeaderText="Order ID" IsPrimaryKey="true" TextAlign="Right" Width="90"/> <ej:Column Field="CustomerID" HeaderText="Customer ID" Width="90" EditType="Dropdown" />
. . . . . . .
</Columns>
</ej:Grid>
[Default.aspx]
List<Customer> customers = new List<Customer>(); protected void Page_Load(object sender, EventArgs e) { customers.Add(new Customer() { text = "Andreas", value = "Andreas" }); customers.Add(new Customer() { text = "Frank" , value = "Frank" }); customers.Add(new Customer() { text = "Willi" , value = "Willi" }); customers.Add(new Customer() { text = "Horst" , value = "Horst" }); customers.Add(new Customer() { text = "Manfred", value = "Manfred" }); BindDataSource(); }
private void BindDataSource() { . . . . . . .
this.OrdersGrid.DataSource = order; var index = this.OrdersGrid.Columns.FindIndex(col => col.Field == "CustomerID"); this.OrdersGrid.Columns.ElementAt(index).DataSource = customers; this.OrdersGrid.DataBind(); }
[Serializable] public class Customer { public Customer() { } public Customer(string text, string value) { this.text = text; this.value = value; } public string text { get; set; } public string value { get; set; } }
} |
By using the DataSource property in Grid columns, we can bind the datasource to the columns in editmode.
Please let us know If you have any queries.
Regards,
Balaji Marimuthu
This was very very useful! Thanks!
But I'd like to say that I found another way to do it using
a custom template with an independent dropdown ;)
Thanks anyway