Datagrid
-
I want to keep each feild in particular width. How should I do this. I set width property , but not working
-
Hi, Can u tell us exactly how u r setting the width of columns in the datagrid? Thanks and Regards, Chetan Ranpariya
-
Hi, Can u tell us exactly how u r setting the width of columns in the datagrid? Thanks and Regards, Chetan Ranpariya
-
Hi, Not getting the problem. You want your columns to be with fixed width or u want them to be resize as per the length of content?
Thanks and Regards, Chetan Ranpariya
-
Hi, Not getting the problem. You want your columns to be with fixed width or u want them to be resize as per the length of content?
Thanks and Regards, Chetan Ranpariya
-
I have a description column in my data grid. In the datagrid I don't want to show full description. only I want to show full description in details view.
Hi, Then you should explicitly trim you description value coming from the database. This you can do in the ItemDataBound event of the datagrid. private void dg_ItemDataBound(object sender, DatagridItemEventArgs e) { if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternateItem) { if(e.Item.Cells[2].Text.Legth > 50) { e.Item.Cells[2].Text=e.Item.Cells[2].Text.Substring(0, 49) + "..."; } } } Here column 2 in the datagrid is bound to the description field of the datasource. I hope this will help you. Thanks and Regards, Chetan Ranpariya
-
Hi, Then you should explicitly trim you description value coming from the database. This you can do in the ItemDataBound event of the datagrid. private void dg_ItemDataBound(object sender, DatagridItemEventArgs e) { if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternateItem) { if(e.Item.Cells[2].Text.Legth > 50) { e.Item.Cells[2].Text=e.Item.Cells[2].Text.Substring(0, 49) + "..."; } } } Here column 2 in the datagrid is bound to the description field of the datasource. I hope this will help you. Thanks and Regards, Chetan Ranpariya
-
Thanks, I am very new to this field can u help me if I am giving this in codebehind and should I do anything in source code(Template feild).
Hi, Put this is in codebehind and replace "private" with "public" and u have to do one thing in the .aspx file. set "OnItemDataBound" property of datagrid to "dg_ItemDataBound". I hope this will help you. Thanks and Regards, Chetan Ranpariya
-
Hi, Put this is in codebehind and replace "private" with "public" and u have to do one thing in the .aspx file. set "OnItemDataBound" property of datagrid to "dg_ItemDataBound". I hope this will help you. Thanks and Regards, Chetan Ranpariya