C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






calender control in datagrid


Posted Date: 01 Jul 2008      Total Responses: 3

Posted By: rameshgoudd       Member Level: Gold     Points: 1



how can i place the calender control in asp.net datagrid




Responses

Author: Sujit Kumar    01 Jul 2008Member Level: DiamondRating:     Points: 1

you can add calendar control in template column under column of datagrid.


Author: SSN    01 Jul 2008Member Level: GoldRating:     Points: 4

Create a template field in data grid
click on data grid and give edit template
then add calender control on item template
of template field... then exit edit template
then you can see the calender control on all
rows of the datagrid


all the best
regards
naushad



Author: Siva    01 Jul 2008Member Level: GoldRating:     Points: 6

<asp:GridView ID="GridView1" runat="server" OnRowEditing="GridView1_RowEditing">
<Columns>
<asp:TemplateField HeaderText="SampleDate">
<ItemTemplate>
<asp:Label ID="Lbl_BrandName" runat="server" Text='<%# (DataBinder.Eval(Container.DataItem, "SampleDate")) %>'></asp:Label>
</ItemTemplate>

<EditItemTemplate>
<asp:Calendar ID="Calendar1" runat="server" VisibleDate='<%# (DataBinder.Eval(Container.DataItem, "SampleDate")) %>'></asp:Calendar>
</EditItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowEditButton="True" />
</Columns>
</asp:GridView>




protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindData();
}
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
BindData();
}
private void BindData()
{
DataSet StrDs = new DataSet();
SqlCommand StrCmd = new SqlCommand("Select * From TableName", SqlConnection);
SqlDataAdapter StrDta = new SqlDataAdapter(StrCmd);
StrDta.Fill(StrDs);
GridView1.DataSource = StrDs;
GridView1.DataBind();
}








Post Reply
You must Sign In to post a response.
Next : Sockets
Previous : Toogle-Urgent
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use