Why the webdatagrid update the text property according to value property after row data updated?
my text property is a link text. How can i keep the Text property after Row data updated?
Hello foxbabby,
Thank you for contacting Infragistics.
I have a few questions concerning this matter. Can you please clarify the issue you are seeing? What type of column do you have? Are you formatting a link? What is the text property you are trying to keep? How are you updating the row?
Sincerely, Mike P. Developer Support Engineer II Infragistics, Inc. www.infragistics.com
My webDatagrid have three columns : column A and column B and column C。 column A is a UnBoundCheckBoxField
the data is :
A B c
false 2 aa
false 4 bb
In WebDataGrid_PreRender,I change the column A as following code:
for (int i = 0; i < WebDataGrid1.Rows.Count; i++)
{
WebDataGrid1.Rows[i].Items.FindItemByKey("B").Text="<a style='color:Blue;text-decoration: underline;' href=www.baidu.com'>"+WebDataGrid1.Rows[i].Items.FindItemByKey("B").Text+"</a>";
}
When I choose the checkbox in column A, I find the column B lose the link information. It seems to the Text property has changed to Value property.
Thank you for the update. I recommend you use the FormatFieldMethod to apply the link format to your column or use the DataFormatString in the markup:
http://help.infragistics.com/NetAdvantage/ASPNET/2013.1/CLR4.0/?page=Infragistics4.Web.v13.1~Infragistics.Web.UI.GridControls.ControlDataField~FormatFieldMethod.html
If you use the FormatFieldMethod I recommend you use the InitalizeRow event as it will fire for each row instead of you having to loop though each row you have.
http://help.infragistics.com/NetAdvantage/ASPNET/2013.1/CLR4.0/?page=Infragistics4.Web.v13.1~Infragistics.Web.UI.GridControls.WebDataGrid~InitializeRow_EV.html
Please let me know if you have any further questions concerning this matter.