I'm setting the alignment and I have to call Databind after working on the data a bit with this code
ultraGrid.DataSource = dt;
ultragrid.DataBind();
but when I do all the texthalign properties for the columns get set back to left, any ideas how to keep the alignment settings when calling databind? Thank you, Jamie
Hi Jamie
I would suggest handling the InitializeLayout event and putting your alignment code into there.
InitializeLayout gets called every time data is set on the grid so it would guarantee your alignment gets applied every time.
Hope this helps!
I won't be able to do that because I allow the user to set the alignment of the columns
By the way... if you are setting the DataSource property, then calling DataBind is redundant. Setting DataSource or DataMember, or calling the SetDataBinding method does an implicit DataBind.
Great idea, it worked like a charm, thank you for your time!
Hmm off the top of my head the only thing I can think of for that is to persist the layout somewhere (perhaps a memory stream) before your DataBind call and then reload it afterwards (see UltraGridLayout.Save())