New Message on dotNET User Group Hyd

Regarding Datagrid Problem

Reply
  Reply to Sender   Recommend Message 2 in Discussion
From: Mahendrakumar8

Another way is
 
List.aspx
 
   <asp:datagrid id="grSupportHour" runat="server" Height="180px" Width="755px" AutoGenerateColumns="False"
    CellPadding="2" HorizontalAlign="Center" Font-Size="8pt" Font-Name="Verdana" BackColor="#EFEFEF"
    BorderColor="#FFFFFF" Font-Names="Verdana" AlternatingItemStyle-BorderColor="#FFFFFF" AlternatingItemStyle-BorderStyle="Dashed">
    <HeaderStyle HorizontalAlign="Center" BackColor="#D6EBF3"></HeaderStyle>
    <Columns>
     <asp:TemplateColumn HeaderText="Select">
      <HeaderStyle HorizontalAlign="Left" Font-Bold="True" ForeColor="#4198A5"></HeaderStyle>
      <ItemTemplate>
       <asp:Label ID="hdnStoreID" Text='<%#DataBinder.Eval(Container.DataItem, "SupportHourID") %>' Runat=server />
      </ItemTemplate>
     </asp:TemplateColumn>
     <asp:TemplateColumn  HeaderText="SupportHourName">
      <HeaderStyle HorizontalAlign="Center" Font-Bold="True" ForeColor="#4198A5"></HeaderStyle>
      <ItemTemplate>
       <asp:Label ID="lbProductid" Text='<%# DataBinder.Eval(Container.DataItem, "SupportHourName") %>' Runat=server />
      </ItemTemplate>
     </asp:TemplateColumn>
     <asp:TemplateColumn HeaderText="Hour">
      <HeaderStyle HorizontalAlign="Center" Font-Bold="True" ForeColor="#4198A5"></HeaderStyle>
      <ItemTemplate>
       <asp:Label ID="Label1" Text='<%# DataBinder.Eval(Container.DataItem, "Hour").ToString() + "," + DataBinder.Eval(Container.DataItem, "Time").ToString() %>' Runat=server />
      </ItemTemplate>
     </asp:TemplateColumn>
    </Columns>
   </asp:datagrid>
 
List.aspx.cs
<asp:TemplateColumn HeaderText="Hour"><asp:Label id=Label1 Text='<%# DataBinder.Eval(Container.DataItem, "Hour").ToString() + "," + DataBinder.Eval(Container.DataItem, "Time").ToString() %>' Runat="server"></asp:Label></asp:TemplateColumn> 
<asp:TemplateColumn HeaderText="Hour"><asp:Label Text='<%# DataBinder.Eval(Container.DataItem, "Hour").ToString() + "," + DataBinder.Eval(Container.DataItem, "Time").ToString() %>' Runat="server">DataSet ds = new DataSet();

DataTable tb = new DataTable();

tb.Columns.Add("SupportHourID");

tb.Columns.Add("SupportHourName");

tb.Columns.Add("Hour");

tb.Columns.Add("Time");

DataRow tr = tb.NewRow();

tr["SupportHourID"] = "1";

tr["SupportHourName"] = "sdfsd";

tr["Hour"] = "10";

tr["Time"] = "30";

tb.Rows.Add(tr);

ds.Tables.Add(tb);

grSupportHour.DataSource = ds.Tables[0].DefaultView;

grSupportHour.DataBind();

 

Thanks & regards,

A. Mahendra kumar

</asp:Label></ITEMTEMPLATE></asp:TemplateColumn></COLUMNS>

View other groups in this category.

Click here!
Also on MSN:
Start Chatting | Listen to Music | House & Home | Try Online Dating | Daily Horoscopes

To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings.

Need help? If you've forgotten your password, please go to Passport Member Services.
For other questions or feedback, go to our Contact Us page.

If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list.
Remove my e-mail address from dotNET User Group Hyd.

Reply via email to