Grid question


I am trying to create a grid based on the attach file but I am not able to merge the columns 6 to 9 the way it is shown.

Can anyone please help me with this? I am using html tags in C# class

I am attaching the excel file on how my grid should look like.
Who is Participating?
Deepak LakkadCommented:

I think you cannot get this result in Simple GridView, you have to use Repeater control for that

- Deepak Lakkad
ram1217Author Commented:
Can you provide me a sample of code on how this can be done based on the file attached?
The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Deepak LakkadCommented:
Ok, I will work on it and try to solve your problem

- Deepak Lakkad
SAMIR BHOGAYTAFreelancer and IT ConsultantCommented:
hi.. you can do this with this example

I have created ASP.NET page which is very straight forward with only one Button and GridView control on it. Following is the HTML source for the (.aspx) file.

<form id="form1" runat="server">
   <asp:button id="Button1" runat="server" onclick="Button1_Click" text="Display Excel Data" />
   <asp:gridview id="GridView1" runat="server" cellpadding="6" gridlines="None"
        bordercolor="#336699" borderstyle="Solid" borderwidth="1px">
        <headerstyle backcolor="#336699" font-bold="True" forecolor="White" />

In the C# code of the button Click event I will connect and read Excel file and then I will bind the data to GridView control. To connect Excel file you need to use Microsoft Jet OLEDB data provider as you can see from the following connection string. The path of the excel file is provided by using ASP.NET DataDirectory feature which points to the App_Data folder in your Website.

string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|SearchEngines.xls;Extended Properties='Excel 8.0;HDR=Yes;'";

string query = "SELECT * FROM [Sheet1$]";

DataSet excelDataSet = new DataSet();
OleDbDataAdapter da = new OleDbDataAdapter(query, strConn);


GridView1.DataSource = excelDataSet;

I hope this will help many of you specially.
ram1217Author Commented:
Thank you for the code above but I cannot implement this way of adding a button since that is not part of requirement.

Any other way to do this? I need to get this done asap, any help would be great.
ram1217Author Commented:
Thank you johny_bravo1, the links you sent me worked amazing.

I was able to create the grid and everything looks fine.

Thank you very much for your help!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.