Hi,
I have an UltraWinGrid on my APP that has a cell with a DropDownCalendar Style.
When I pick a date, it shows the date on the cell on the format, p. e., 19/09/2012. I save the value and I open my APP again and it shows "19092012".
I've tried to set the value on the INitializeLayout event with this code:
DateTime dt = Convert.ToDateTime(el.New); row.Cells["Value"].SetValue(dt, false);
DateTime dt = Convert.ToDateTime(el.New);
string date;
date = dt.Day + "/" + dt.Month + "/" + dt.Year;row.Cells["Value"].SetValue(date, false);
But, it doesn't worked.
Can you help me? Thank you.
Best regards,
Maria
Hello Maria,
So we could add the following line after the e.Cell.EditorComponent = null; :
e.Cell.DroppedDown = true;
Please do not hesitate to ask if something comes up.
Boris,
I was able to solve my problem with the line you suggest.
Thank you.
Unfortunetly, I found another problem...
When I click on the cell it doesn't show me the Calendar on the first time that I click.
Then, If I click again it shows the calendar perfectly...
Can you help me?
Thankyou,
You are on the right track, but the editor is still there regardless of setting the column style. So after using this code in the ClickCell event, you could add the following line:
e.Cell.EditorComponent = null;
Please do not hesitate to contact me if you need any additional assistance.
Hello Boris,
I was able to solve my problem using the Toolbox at design time.
But now, I have another one.. When I load my grid the date is well format but I want to use ClickCell event to change the cell style to DropDownCalendar but I can't.
Can you tell me what's wrong?
Code sample:
On Initialize_Row Event:
e.Row.Cells["Value"].EditorComponent = this.ultraMaskedEdit1;
On ClickCell Event:
e.Cell.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownCalendar;
If you have our controls, this one should be there also. If you drag it out from the toolbox it should add the references to the DLL library by itself. It should be there unless you have asked for just certain controls, not our whole package. Is this the case?