I have an unbound coulmn on ultragrid, of type object. On RowInitialize I set the cell style for unbound coulmn to numeric, datetime, dropdownList... depending on anothe coulmns value.
private void gridPropertyInstance_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
{
long dataTypeId = (long)e.Row.Cells["PropertyDataTypeId"].Value;
switch (dataTypeId)
case (long)PropertyDataTypeEnum.DateTime:
e.Row.Cells["DisplayValue"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Date;
break;
case (long)PropertyDataTypeEnum.List:
e.Row.Cells["DisplayValue"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
case (long)PropertyDataTypeEnum.Numeric:
e.Row.Cells["DisplayValue"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Double;
}
This works fine but setting style to Date makes it slow. I have tried removing date styling from rowinitialize to cellclick, which makes loading quick but cell click is slow now.
Is there work around and any other approach that I should go for?
Basically I have an entity with 3 properties : name , displayvalue(string), type.
Ddepending on type displayvalue format can be character, list, numeric, datetime...
On grid I need to display list of entity and should be able to edit displayvalue.
Thanks for help.
Hello,
When I try to open your solution or project my Visual Studio crashes. Could you please send me the solution for Visual Studio 2010 so I could try and open it again since in 2012 this is not possible for me.
Hi Boris,
Thanks for your time.
My problem is that the "DisplayValue" is of string type, that means when not set its of emtpy string type.
I have modified the attachment to make it slow :)
Work around that I did was that if value is empty string then have a dummy value i.e. if style requied is date then any date value,
and then set the style. and remove value then.
If there a better a solution, please help.
I tried this and it always works fine for me so I attached my sample to this post for you. Please review it and feel free to let me know if I misunderstood you or if you have any other questions.
Looking closly into it , realised if displayvalue is empty string, it takes longer otherwise its fine.
Still don't know how to solve it :(