Hi guys,
I want to bind a web date chooser to a column in a web grid in the client side using javascript, i.e when i click on the cell, a web date chooser should pop up.
If u guys have any idea,plz help?
Hi,
This is the way where you can bind the web date chooser to the grid. It will pop up the date chooser when user double clicks on that column.
(1) Add Web date chooser control in the aspx page. You can set its other properties also.
<igsch:WebDateChooser ID="WebDateChooser1" runat="server" >
</igsch:WebDateChooser>
(2) Bind with the specific columns in the server side code.
DataTable table1 = GetData();
grid1.DataSource = table1;
grid1.DataBind();
grid1.Columns[2].Type = ColumnType.Custom;
grid1.Columns[2].EditorControlID = WebDateChooser1.ID;
grid1.Columns[2].AllowUpdate = AllowUpdate.Yes;
Make sure that your column should be of type DateTime.
Do you want this to be done in client side? Could you explain your technical requirement in detail?
Let me know if this helps you.
Greetings
The problem is that my aspx page is inside a Master page,when i remove the Master page ,it's working perfectly with the code that you have provided.,do you know the reason why?
How can i include Master page as well as the Web date Chooser?
To expand upon HBA's answer:
You have to connect WebGrid columns to their embeddable editor providers (such as WebDateChooser) in server-side .NET code. This cannot be done in client-side JavaScript code.