BoldDeskBoldDesk is now live on Product Hunt with a special offer: 50% off all plans. Let's grow together! Support us.
Hello, I'm currently using SfDataGrid to display data from multiple tables. The problem is that in some I need editing to be allowed, but even though it is indeed allowed when I run the app and click on the cells nothing happens, it is read only.
Because sfdatapager does not accept datatable, I'm converting it to a ienumerable list as the component requires, and the data displays. Heres some code
As I mentioned before, the data is displaying correctly in the grid. The only problem is that I cant trigger the edit. Is there a way to solve this or a better way to convert
Hi Alejo Yanczuk,
The reported problem occurs due to you are created the property with the getter
alone. Refer to the below screenshot,
If you need to make this property editable, then you should create the property
along with a setter as shown below.
public class OrderInfo : INotifyPropertyChanged {
string customerId;
public string CustomerID { get { return customerId; } set { customerId = value; this.OnPropertyChanged("CustomerID"); } } }
var table = this.GetDataTable(); //This is the converter var data = table.AsEnumerable().Select(row => new OrderInfo { OrderID = decimal.Parse(row["OrderID"].ToString()), CustomerID = row["CustomerID"].ToString(), CustomerName = row["CustomerName"].ToString(), Country = row["Country"].ToString(), ShipCity = row["ShipCity"].ToString()
});
|
Find the sample demo in the attachment.
Regards,
Vijayarasan S
If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.