Problem with datagrid fixed column
-
Dear All, i have a datagrid control with 3 columns. the first column is a template column with radio buttons. to keep the Column width fixed i added the attributes "TABLE-LAYOUT: fixed ; OVERFLOW:hidden". It is woking fin. But the problem is that the radio button column also have the same size as the remaining and it is not looking good.Can i keep the radio button column to a fixed width? at the same time i want that the cell data should be clipped if it exceeds the cell width. ThanX in advance
Ramesh.Kanjinghat
-
Dear All, i have a datagrid control with 3 columns. the first column is a template column with radio buttons. to keep the Column width fixed i added the attributes "TABLE-LAYOUT: fixed ; OVERFLOW:hidden". It is woking fin. But the problem is that the radio button column also have the same size as the remaining and it is not looking good.Can i keep the radio button column to a fixed width? at the same time i want that the cell data should be clipped if it exceeds the cell width. ThanX in advance
Ramesh.Kanjinghat
-
Dear All, i have a datagrid control with 3 columns. the first column is a template column with radio buttons. to keep the Column width fixed i added the attributes "TABLE-LAYOUT: fixed ; OVERFLOW:hidden". It is woking fin. But the problem is that the radio button column also have the same size as the remaining and it is not looking good.Can i keep the radio button column to a fixed width? at the same time i want that the cell data should be clipped if it exceeds the cell width. ThanX in advance
Ramesh.Kanjinghat
Yes u can give width of each column in pixels and in percentages at the design time.
Do good and have good.
-
Well. Wrapping requires that the text has spaces embeded. Even it works it will increase the cell height. Actually i am providing tool tip to display the text clipped.
Ramesh.Kanjinghat
-
Yes u can give width of each column in pixels and in percentages at the design time.
Do good and have good.
ThanQ for the reply. I have tried that way too. but when i do so. the column with cell that have data exceeding the limit is getting enlarged as long as the data.
Ramesh.Kanjinghat
-
Dear All, i have a datagrid control with 3 columns. the first column is a template column with radio buttons. to keep the Column width fixed i added the attributes "TABLE-LAYOUT: fixed ; OVERFLOW:hidden". It is woking fin. But the problem is that the radio button column also have the same size as the remaining and it is not looking good.Can i keep the radio button column to a fixed width? at the same time i want that the cell data should be clipped if it exceeds the cell width. ThanX in advance
Ramesh.Kanjinghat
Hi friends, I got the work around for the above said problem. As i am setting the property TABLE-LAYOUT:fixed, the property will be apllied at client side. So we have to set the width of the columns using css class only. Below sample will help you understand the same.
DataGrid1.Attributes.Add("style","TABLE-LAYOUT: fixed; OVERFLOW: hidden");
The above code will force the grid to have eqaul column widths.DataGrid1.Columns[0].ItemStyle.CssClass="SetWidth"
where SetWidth is given as below in the style tag .SetWidth4Temps { WIDTH: 40px } Hope this will help you all. Cheers :-D Ramesh.Kanjinghat