.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
satyapriyanayak
SP
abhays
Sasi Prabhu
Post New Web Links

Assign Dynamically data to Gridview according to the condition

Posted By:      Posted Date: November 16, 2010    Points: 0   Category :ASP.Net
 

Hi All,

 I have Gridview with column name END Date.

DATE is dd/mm/yyyy Format

Available data is :-  START DATE = 1/1/2010 ,  STOP DATE = 1/4/2010  ,INTERVAL = 1 WEEK

HOw to bind data to gridview such that gridview should display data from 1/1/2010 to 1/4/2010 for the interval of 1week

THE OUTPUT SHOULD BE:-

END DATE

1/1/2010

7/1/2010

14/1/2010

'

'

'

1/4/2010

Thanks in advance.

 




View Complete Post


More Related Resource Links

How can i add a textbox into a GridView Cell dynamically and how can i retrieve entred data

  
Hey, i think that the the subject can explain what i need, it's about adding a TextBox control with the code behind into a GridView, and also about how can i retrieve entered data after submitting, im using C#,Thanks.

How to fetch data from textbox dynamically in a gridview

  
How to fetch data from textbox inside a gridview

Assign Value to DropDownList in GridView Dynamically

  
Hi, I got GridView with 2 columns both are Template field with drop down list. What I need to do is someting like when user select course 3/3A/2A/2B , the type column will auto select pratical option dynamically. When select RTT /FTT/BTT , the type column will select Theory option. Can someone tell me how to work on this thing. Thank you. <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">  <Columns>  <asp:TemplateField HeaderText="Course">  <ItemTemplate>  <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">  <asp:ListItem>2A</asp:ListItem>  <asp:ListItem>2B</asp:ListItem>  <asp:ListItem Value="3">3</asp:ListItem>  <asp:ListItem>3A</asp:ListItem>  <asp:ListItem>BTT</asp:ListItem>  <asp:ListItem>RTT</asp:ListItem>  <asp:ListItem>FTT</asp:ListItem>  <asp:ListItem></asp:ListItem>  </asp:DropDownList>  </ItemTemplate>  </asp:TemplateField>  <asp:TemplateField HeaderText="Type">  <ItemTemplate>  <asp:DropDownList ID="DropDownList2" runat="server">  <asp

Display XML Data in GridView Dynamically

  

how to display data in gridview dynamically using code behind, if the xml data is available in string variable (i don't want to use xml file for carrying data). plz let me know as soon as possible


Editing the Data in a GridView

  
In addition to deleting a GridView's underlying data, another common need is to allow end users to edit the data displayed in a GridView. With ASP.NET 1.x's DataGrid control, editing the data is certainly possible, but requires creating three event handlers and writing a dozen or so lines of code. With the GridView and ASP.NET 2.0, it is possible to create an editable GridView without writing a single line of code! All of the necessary functionality is encapsulated within the GridView.

The GridView allows editing on a row-by-row basis. An editable GridView contains an additional column with an Edit button in each row. When the end user clicks on an Edit button that row becomes editable, causing the Edit button to change to Update and Cancel buttons and the other columns to become TextBoxes. The end user can then update one or more column values and click Update to save their changes.

Display data in gridview dynamicallay

  
I have AD domain which has 100000 users, I want to display all the users in gridview controls.Actually it is displaying users in gridview after parsing entire domain which takes around 30 min. I want to display the users while loading itself.It is continously getting user information from AD domain and getting each user details, I want to display the users information which already queried instead of waiting till getting all users information

asp.net display data in gridview

  
i want to display data in gridview binded to a sql datasource
but the problem part is i want to bind a field of that datasource to a dropdownlist and when a item is selected in that dropdownlist then correcposnding to that data will be displayed in gridview...

display data into GridView from excel sheet

  
I have to display data from excel sheet into my gridview and also I need to figure out a way to store data into excel files from my web page. I am using C# 3.5, VS 2008.

GridView control to show master-child or master-slave data, written in c#, asp.net

  
I previously made a master slave datagrid using Visual Studio 2003 .Net (original article) that would allow users to show data to clients using collapse and expand features. These features however did not carry over to gridview for many users. This tutorial will explaing how to create a collapsable/expandable gridview in frameworks 2.0 and higher

Easily manipulate data with the GridView control in ASP.NET 2.0

  
Last week, I introduced ASP.NET 2.0's GridView data control and covered the basics of using it. This week, I go a step further by going into the details of working with the data contained in the control. This includes viewing, editing, and deleting data. Thankfully, the GridView control makes it easy to utilize these features. Before diving into these topics, I begin with an examination of the different field types supported by the GridView control.

Display Related Data in an ASP.NET GridView

  
Typically when you display a datagrid you will want to show data from a related table. There are 3 different ways to accomplish this with NetTiers. You can use a custom stored procedure, deepload functionality from the code behind, or a strongly typed datasource control. We'll provide an example of each

Sorting Data in a GridView Web Server Control

  
The GridView control provides built-in sorting functionality without requiring any coding. You can further customize the sort functionality of the GridView control by using custom SortExpression property values for columns as well as by using the Sorting and Sorted events

Rendering data with HTML tags in the DD Gridview for a selected column

  

I am having trouble finding out where and how to HTML Encode a cell's data on the Dynamic Data (v4.0) gridview of List.aspx.  As a simple case, suppose I have formatted cell data that is A<br/>B in the DB.    Obviously, I want A stacked on B in the cell.

It seems gridView1.HtmlEncode = true has gone away.

So maybe I'll try to catch it on the RowDataBound event:

protected void GridView1_RowDataBound(Object sender, GridViewRowEventArgs e)

        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                // Html Encode the cells
            }

        }

but this event never fires?


Has anyone figured out how to properly render HTML tags data in the List.aspx's GridView1? 

If I figure this out, then I can add a MetaAttribute called something like [EncodeAsHtml(true)] and be on my way.  Thanks!


Export Gridview data to Excel sheet

  

Hi ,

     I have a requirement where i need to export the gridview data to excel.My code export the data in excel that was fine.

But the enchancement needed now , I was exporting the 3 gridview in same excel sheet under the workbook.

Now i need to export the 3 grid view in 3 different sheet in the same workbook.


so can please tell or share the updated code in my below code ...

public void writeovrsummary()
    {

Response.Write("<BR>");

        Response.Write("Overall Summary");
        //Response.Write("<BR>");
        //Response.Write("Report as of " + DateTime.Now.ToString("hh:mm ss tt"));

        StringWriter sw = new StringWriter();
        HtmlTextWriter hw = new HtmlTextWriter(sw);

        SqlCommand com = MyConnection.CreateCommand();
        com.CommandText = "useroverall_Report";
        SqlParameter[] par = new SqlParameter[1];
        par[0] = new

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend