|
Nope, this would not work at all; at least for my code. As I said on my question, i can reorder all the columns as expect, and i check that the ICollection that return from the CreateColumns is correct. But however, the data that is bound to the table is not correct.
Actually, i already have the solution. I would post here if someone interest.
|
|
|
|
|
Tee+ wrote: Nope, this would not work at all; at least for my code
Not sure what you do with your custom control, but it does work in my case when I simply declare 3 fields in the exGridView control and use a sqldatasource to feed data. Anyway, glad you solved your problem.
|
|
|
|
|
Oh yeah, this might be the cause. I use ObjectDataSource. And i think the GridView do a early bound and cache it something like [ColumnIndex, Value]. Therefore, even if i reorder all columns, but when doing a actual binding The grdiview doesn't use the datafield in each column to retrieve the data, but use the cache data and the column index.
-- modified at 10:31 Saturday 19th August, 2006
|
|
|
|
|
Hi friends I want to convert my asp.net 2003 project into asp.net2005 (using VB).
So pls tell me how to convert it.
Pls tell will conversion effct on any of my controls in vs2003
also
I am new to asp.net2005 .So PLS TELL ME WHAT happens if i took datagrid in my project AS THERE IS NO DATAGRID IN VS2005.
|
|
|
|
|
|
thanks for the link. i did a manual conversion though, by copying and paste one by one.
thanks in advance. Much appreciated.
|
|
|
|
|
always welcome..
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi!
I hv the datagrid name as dg. i want to do paginng in that dg control.
I am using c#.
I fetched the imagebutton control name as img to the dg.
If we clicks that img it has to go another form(Models.aspx).
For this i used:
dg_itemdatabound event for find the control (img)
dg_itemcommand event for redirects to next page(Models.aspx)
Now i used 3rd event for the same dg control:
dg_Pageindexchanged event for paging.
Problem is:
I got the Prev & Next Buttons in the dg but if i clicks that one it redirects the page to Models.aspx (which is i mentioned in the itemcommand event)
instead of that it has to display the remaining values...
I hope u got my problem.., How can we solve this one?
Another one: How to Paging in DataList?
Prabu.T
|
|
|
|
|
I have a Problem when iam passing the Parameters through QueryString in javaScript. please help me in this regard.
venugopal
|
|
|
|
|
Hi,
Please specify what problems you are facing ? By the way you have to start query string with a '?' marks and between two parameters you have to put a '&'. Also there is no need to put the param values in single or double quotes !
If you can specify some details, it would be easier for all here to understand actuall situation !
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
hi,
iam having an application .i want to open user defined popup window on right click of mouse.is any budy know the solution
kamalnath
|
|
|
|
|
Hi,
If it is a Web Application then i dont think that it is possible in pure ASP.NET. You will have to use java script for that.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
You may have a look at the oncontextmenu[^] event to see how to use it to open a pop-up window with the right click action.
|
|
|
|
|
hi dear
i want to know what this response.addheader() method do. we use this method whenever we need to open a word ,excel, mpeg etc.. file in our internet explorer and
i want to know what exactly it do, what will happen if we donot provide this...
Thanks & Regards
Vishal Sharma
vishalsharma556@yahoo.co.in
|
|
|
|
|
It's simple, the method is used to add the headers to the Response object which is later sent back to the client. I think the topic you may want to learn more is the header part of a Http message, check out this rfc[^]
|
|
|
|
|
Is it possible to open a popup window on right click on a row of a datagrid at
client side?
SAM.
|
|
|
|
|
Yes, it is. You can look at the oncontextmenu[^] event, and lots of datagrid examples from this girl[^]
|
|
|
|
|
|
In C#, .NET 2.0. I have a gridview in frm_Report which looks like this.
i have used the sqldatasource to bind the data.
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="Stud_Admin" DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="Stud_Admin" HeaderText="Stud_Admin" ReadOnly="True" SortExpression="Stud_Admin" />
<asp:BoundField DataField="Stud_Name" HeaderText="Stud_Name" SortExpression="Stud_Name" />
<asp:HyperLinkField HeaderText="" Text="View" DataNavigateUrlFields="Stud_Admin" DataNavigateUrlFormatString="frm_StudReport.aspx />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:FYPJ_TestDBConnectionString2 %>"
SelectCommand="SELECT [SN], [Stud_Admin] FROM [Stud_Particulars]">
</asp:SqlDataSource>
In my another form frm_Show is basically this.
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
When user select the hyperlink View, the hyperlink will grab value of Stud_Admin of the selected row in gridview and display it at Label1. What is the next code should I add?
thanks in advance. Much appreciated.
|
|
|
|
|
use Row.RowIndex property to get the selected row..
use RowCommand event of GridView.
Regards,
Jay
|
|
|
|
|
I don't know what to do next. By getting the values, how will the hyperlink be clever to pass value to label in another form. And what is the syntax for Label1.text = ? By using findcontrol?
And
protected void GridView8_RowCommand(object sender, GridViewCommandEventArgs e)<br />
{<br />
GridViewRow row = GridView8.Rows[0];<br />
}
thanks in advance. Much appreciated.
|
|
|
|
|
If the Stud_Admin text is simple, you may consider passing the value along with the url in the query string (set this DataNavigateUrlFormatString="frm_StudReport.aspx?Stud_Admin={0}" )so that you can get it from the Request object in the next page . In addition, you still have many other choices:
+ Try to retrieve again in DB based on the id passed from the source page when the text is long.
+ Try to use the LinkButton, so before redirecting to the next page you can save the text in the Session.
|
|
|
|
|
Thank you. It works.
minhpc_bk wrote: (set this DataNavigateUrlFormatString="frm_StudReport.aspx?Stud_Admin={0}" )
But I was just wondering what does Stud_Admin={0} means?
If I want to pass two values which is Stud_admin and the next column just next to Stud_Admin? What will the longer DataNavigateUrlFormatString = be?
thanks in advance. Much appreciated.
|
|
|
|
|
|
I still don't understand.
I am using codebehind. And initially i can fetch one data from the gridview to another webform and display it in the label.
I want to experiment and fetch two datas from the gridview to another webform and display it in the label.
<Columns>
<asp:BoundField DataField="Stud_Admin" HeaderText="Admin No" ReadOnly="True" SortExpression="Stud_Admin" />
<asp:BoundField DataField="Stud_Name" HeaderText="Student Name" SortExpression="Stud_Name" />
<asp:HyperLinkField Text="View" DataNavigateUrlFields="Stud_Admin" DataNavigateUrlFormatString="frm_StudReport.aspx?Stud_Admin={0}"/>
</Columns>
And another webform at the page load,
<code>Label1.Text = Request.QueryString["Stud_Admin"];</code>
How can I fetch the Stud_Name as well and display it in Label2.text?
thanks in advance. Much appreciated.
|
|
|
|