Click here to Skip to main content
15,907,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The dataGridView is not displaying the values on each cell even though data is present on the cells...The values are visible only on cell which is having the current focus...But its not set to be visible on cellclick
Posted
Comments
Michael Waguih 7-Feb-11 4:55am    
Can you add the code which displays your data in the datagridview
khalid mehmood 7-Feb-11 5:14am    
Hi, try using auto generated colums.
One more thing just press Ctrl+ A on web page if text gets highlited.
then there is something wrong with css on the page.

i hope this might help
coolestCoder 7-Feb-11 5:14am    
Can you please add the column definition too.

A sample Gridview can be created with the following code:
XML
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
        <Columns>
            <asp:BoundField DataField="country" HeaderText="Country" ReadOnly="True" SortExpression="country" />
        </Columns>
    </asp:GridView>


The following code is used in the page_load event
string sql = "Select * from countries Order By Country";
        SqlDataAdapter da = new SqlDataAdapter(sql, "Data Source=SSSLT71\\SQLEXPRESS08;Initial Catalog=Test;User ID=sa; password=123456");
        DataTable dt = new DataTable();
        da.Fill(dt);
        GridView1.DataSource = dt;
        GridView1.DataBind();


Hope this will help you
 
Share this answer
 
try this...

C#
private void get_datagridview_details()
{
    try
    {
       DataSet ds = new DataSet();
       //use your function on there
       // ds = gBL.Show_datagridview_Details();
        gv_party_datagridview1.DataSource = ds.Tables[0];
        datagridview1.readonly=true;
    }
    catch (Exception ex)
    {
       Messagebox.show(ex.message);
    }
}
 
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