Click here to Skip to main content
15,892,804 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
mtxtBdate.Value = dataGridView1.SelectedRows[0].Cells["Birthdate"].Value.ToString();

I want this on data Grid view.. this type of syntax use in all other textboxs.. but now how to use this datepicker control syntax.. this syntax is wrong please tell me write

meas any date that user select on the datetimepicker is show on the datagrid..
C#
mtxtfname.text = datagridView1.SelectRows[0].Cells["fIrstname"].value.ToString();

this sytanx will for text box but for data picker ???
Posted
Updated 15-Jul-12 22:32pm
v2
Comments
Sandeep Mewara 16-Jul-12 4:35am    
Not clear. Can you confirm if you are trying to ask on how to access the datepicker field placed in grid row?
Mohamed Mitwalli 16-Jul-12 4:39am    
You want to take value from datetimepicker and put it in Gridview is this what u mean ?

1 solution

XML
<asp:gridview ID="Gridview1" runat="server" ShowFooter="true" Width="100%"
            AutoGenerateColumns="false" GridLines="Both" CssClass="mGrid">
            <Columns>

            <asp:TemplateField ItemStyle-CssClass="cell" HeaderStyle-CssClass="cell" HeaderText="Date Of Travel">
                <ItemTemplate>
                    <asp:TextBox ID="TextBox1" CssClass="txtbox" runat="server"></asp:TextBox>
                    <asp:CalendarExtender ID="CalendarExtender1" OnClientDateSelectionChanged="checkDate" runat="server" TargetControlID="TextBox1" Format="dd/MM/yyyy">

                        </asp:CalendarExtender>

                </ItemTemplate>
            </asp:TemplateField>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900