We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

setting the grid row height

Hi, I am having a problem with setting the grid row height.i am taking the datagrid rows dynamically by using reflection with below code. System.Reflection.MethodInfo mi = typeof(System.Windows.Forms.DataGrid).GetMethod("get_DataGridRows",System.Reflection.BindingFlags.FlattenHierarchy | System.Reflection.BindingFlags.IgnoreCase | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); System.Array dgra = (System.Array)mi.Invoke(((DataGrid)customGrid),null); rowObjects = new ArrayList(); foreach (object dgrr in dgra) { if (dgrr.ToString().EndsWith("DataGridRelationshipRow")==true) rowObjects.Add(dgrr); } what my requirement is that the textboxcolumn should be multiline.the user will enter the data into the column, while showing the grid i have to show the height of the row with the multiples of width of the column means if the text size is 240 and the width of the column i set is 60 the height of the column should 4 times that of default size to see all the text. what i have done for this is while painting the column i am calculating the required height and setting the height for that row in the grid. The height was set properly.But the grid is re-painting and re-painting and so on....the paint is calling continuosly. Can anyone suggest me what is the right way of setting the row height according to the text in the column and another thing is that instead of setting the wordwrap,multiline properties to true the text is not wrapping if the height increases for the row also. Any suggestion is greatly appreciated. Regards, Ramnadh.

Loader.
Live Chat Icon For mobile
Up arrow icon