|
thanx !
|
|
|
|
|
or
response.redirect("page.aspx");
We are not a Code Charity
|
|
|
|
|
Response.Redirect("PageName.aspx")
Sathya
|
|
|
|
|
Hi i have searched in net,
But i didnt get proper solution...
I have to maintain scroll position for my gridview...,
My gridview which is in inside panel...,
The panel having scroll auto event...,
In my gridview i didnt use any template or button colums...,
Now when i click a bound column it have to maintain the scroll position on that row?,
hwo to do that?,
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
Repeat Post
We are not a Code Charity
|
|
|
|
|
|
I need a column in GridView to be invisible. I tried with some code and its throwing some error. Can anyone help me with this...?
SAJAN A PILLAI
ASP.NET,C#.NET Programmer
BANGALORE
"Winners don't do different things. They do things differently. ...
modified on Friday, June 27, 2008 2:58 AM
|
|
|
|
|
<asp:BoundField DataField="id" Visible="False"
surely its the above,
We are not a Code Charity
|
|
|
|
|
But now if you plan on do that then don't even think about recovering the cell's value on code behind.
At least I've never been able to...
Kazz
"Users are there to click on things, not think. Let the archs do the damn thinking."
|
|
|
|
|
Ariel Kazeed wrote: ecovering the cell's value on code behind.
What do you mean?
We are not a Code Charity
|
|
|
|
|
I mean something like...
Integer ID = Gridview.Cells[0].Text
That would throw an exception. Yes, ASP.NET knows there is a column there even though you cannot see it. Problem is, since the value of that particular column is not printed on the page, it only exists at databinding time. Hence, in this case GridView.Cells[0].Text returns "", that's what I meant.
Kazz
"Users are there to click on things, not think. Let the archs do the damn thinking."
|
|
|
|
|
Hi all,
I am trying to bind teh datagird with a datset at run time I tried the following code but I m not getting any data in datagrid. Can anyone please provide me the correct code. The code is
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim Productds As New DataSet
Dim m_DataAdapter As New SqlClient.SqlDataAdapter( _
"query", "connectionstring")
Dim m_DataSet As New DataSet
' Fill the DataSet.
m_DataAdapter.Fill(m_DataSet, "Demo")
' Bind the DataGrid to the DataSet's first DataTable.
ProductDG.DataSource = m_DataSet.DefaultViewManager
ProductDG.DataMember = "Demo"
End sub
Thanking You!
Rock Star
|
|
|
|
|
Rock Star. wrote: ' Bind the DataGrid to the DataSet's first DataTable.
ProductDG.DataSource = m_DataSet.DefaultViewManager
ProductDG.DataMember = "Demo"
May be you missed something,
' Bind the DataGrid to the DataSet's first DataTable.
ProductDG.DataSource = m_DataSet.DefaultViewManager
ProductDG.DataMember = "Demo"
ProductDG.DataBind()
|
|
|
|
|
Hi,
I put this code in it but still I cant see my datagrid.
Rock Star
|
|
|
|
|
Rock Star. wrote: I put this code in it but still I cant see my datagrid.
First check your query.It returns any dataset.Run that query in Sql Query Analyzer.
regard
kHan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Hi,
I checked my query its perfect. I checked dataset.tables(0).rows.count and its returning number of rows in the dataset. I dont everywhere same code is given to bind the datagrid to dataset. I dont know why it is not working in my case.
Rock Star
|
|
|
|
|
ProductDG.DataSource = m_DataSet.DefaultViewManager
Is there any reason to use DefaultViewManager.
You can also do in this way.
ProductDG.DataSource = m_DataSet.Tables[0]
or
If m_DataSet.DefaultViewManager <> Nothing Then
//bind DataGrid
Else
//Is null
End If
Regard
Khan
please don't forget to vote on the post that helped you.
|
|
|
|
|
hi
I tried ProductDG.DataSource = m_DataSet.Tables[0] in my code but same result. I cant see my datasrid control. But when I am trying to put the condition for m_DataSet.DefaultViewManager <> Nothing it is going in the else part and showing nothing for defaultviemanager.
Rock Star
|
|
|
|
|
Hi,
why are you using m_DataSet.DefaultViewManager anyhow?
I always use things like...
Dataset ds = GetDataset();
Gridview.Datasource = ds.Tables[0];
GridView.Databind();
And works perfectly fine.
I assume the GridView is visible on the aspx marking right? (Sorry for this obvious question, but you never know...)
Kazz
"Users are there to click on things, not think. Let the archs do the damn thinking."
|
|
|
|
|
Try like,
' Bind the DataGrid to the DataSet's first DataTable.
ProductDG.DataSource = m_DataSet.Tables("Demo")
ProductDG.DataBind()
Tell me one thing... Does your DataGrid has columns bounded? Could you please post your *.aspx HTML?
|
|
|
|
|
Yes my datagrid has one bounded column in .aspx file but wen i run the page I am getting an error for "A field or property with the name 'Column name' was not found on the selected data source." but my table has the column I have specified in bond column section of datagrid.
This is the aspx code for datagrid
<asp:gridview id="ProductDG" runat="server" autogeneratecolumns="false" allowpaging="true" pagesize="10" height="182px" width="155px" > <columns>
<asp:boundfield datafield="'Column name" headertext="Name"><br>
</asp:boundfield>
</columns>
</asp:gridview>
Rock Star
|
|
|
|
|
Rock Star. wrote: datafield="'Column name"
Why there is a single quotation(') near Column name
|
|
|
|
|
Its a typing mistake there is no single quote in the code. Do u know why there is no data in my data grid.
Rock Star
|
|
|
|
|
Use a datatable instead of dataset.
and try the GV is displaying or not.
|
|
|
|
|
I tried data table too but same result.
Rock Star
|
|
|
|