Forms Data Controls :: How To Determine The Exactly Datagrids Row And Column That Exists A Button
Feb 11, 2010
how can we determine the exactly datagrids row and column that exists a button that has been pushed?
Protected
Sub ela(ByVal
sender As
Object,
ByVal e
As
System.Web.UI.WebControls.DataGridCommandEventArgs)
' Dim id As Integer = datagrid1.DataKeys(CInt(e.Item.ItemIndex))
Dim id
As
Integer = e.Item.Cells.GetCellIndex
Response.Write(ID)
End
Sub
but how exactly we determine the row and the column?
View 6 Replies
Similar Messages:
Feb 3, 2010
Using vb.net 2003,asp.net 1.1
I have a usercontrol on a page with 2 dynamic datagrids
on it with dynamic custom buttons, I get a questionID from
the buttons and that is ok.
What I need to know is which one of the grids gave me the questionID
so I can transfer to an approriate page.
For Instance:
If gridone was the sender/commandsource Then
Server.Transfer(pg1.aspx)
Else
Server.Transfer(pg2.aspx)
End If
Hope thats enough info,
View 1 Replies
Jan 27, 2010
I currently have a data grid that exports to Excel on an ASP.NET page (which is used for reporting purposes) which works great until we put it under the stresses of a full scale production environment. With a multitude of users using it it seems to fill up the server memory quite quickly since the data thats being pulled is rather large. The requirements of the page are: The data needs to be queried and exported to excel, so theres no point to getting around that. I've noticed that xls files are rather large in comparison to their xlsx counter parts, using xlsx files would be fine for my application. I've noticed that xlsb (Excel binary) are even smaller(approx 25% the size of the their xls counterpart). Is there anyway to change my code to export to xlsb (first choice) or xlsx rather than xls? I think it has something to do with Mime Types but I'm not positive.
Here is the code that I'm using for exporting:
[Code]....
View 8 Replies
Mar 5, 2010
I have started creating a DAL and have successfully bound my adaptor and the query within the adaptor to a gridview.
In lots of the intranet type apps I code in regular ASP for myself I often have a few columns with little icons in that do various things for that rows identity, such as drill down to more details, overlay a graph, text the person via an ajax call, send em an email via ajax and so on.
I think Ive got the hang of styling elements of each row depending on the data but Im completely at a loss as how to add a column which would have an icon whos url link properties would be dependant on the data.
EG
ROW1 | Name | Email Address | ICONFOR EMAIL(with a querystring id matching the row id) | ICON FOR MORE DETAILS (with a querystring id matching the row id)
I realise I am probably looking at this the wrong way but its difficult when you are almost on autopilot doing these things in classic ASP.
View 1 Replies
Jul 22, 2010
How to add a button at first column of gridview and get cell value in another column?
For example, add a button named it as "Click me". Once user clicks will get third column cell's (ID) value.
View 2 Replies
Mar 31, 2011
I have a Datagrid inside a Datagrid and I am trying to perform an action (open an pop-up window with related values in the querystring) when the inner datagrid control is clicked.In this simplified example I have 2 datagrids (datagrid1 and
datagrid2). In the second datagrid (datagrid2) I have a LinkButton (lbViewDetails) that I want to control what it does based on the value in the upper datagrid (datagrid1)'s lblRecordId value.
View 4 Replies
Mar 21, 2011
1) I should have one table-like column, where data are taken from database. It should contain sorted surname-name.
2) Every surname-name is a link to another table-like control. Content of it depans on surname-name that was clicked. This table will contain relatives of particular person.
Say, I have a column with John Anderson, George Washington etc. I click John Andreson and another table load data (relatives of John Anderson) - Anegline Jolly, Peter Pan etc.Then I click George Washingto and another table load data (relative of George Washington) - Zera Zebra, Aflen Aleks etc. Every relative should have a checkbox nearby. So the second table-like control will look like:
Angeline | Jolly | <some other information from db> | <checkbox>
Peter | Pen | <some other information from db> | <checkbox>
etc.
3) I have a button "A-D", When it is clicked, then first table is populated only with surnames with first letter from A to D. I have a button "E-G". When it is clicked, then table is populated only with surnames starting with letters E to G. I have nevere used DataGrids and other db binding controls. Which of them should I use?
View 3 Replies
Feb 1, 2010
I have a Data Grid View which display values from a SQL Query, and inside the data grid view I have two template fields one is Quantity and it is a text box and the other is Total Price and it is a label.
What I want to do is to insert a button called update and when I press this button the price Column should be multiplied by the quantity Column and the result should be displayed in the total Column.
View 11 Replies
Feb 2, 2011
I'm getting a "no data exists for the row/column" error when i am giving wrong value in key column and press button to import data from excel,how can i fix this error and avoid collapsing the application.
[Code]....
View 5 Replies
Aug 17, 2010
I am having a slight problem with a feature I am trying to get working on a website I am doing. I keep getting the "No data exists for the row/column" error. And the problem appears to be with this line of code:
[Code]....
View 3 Replies
Feb 28, 2011
I have some code with a connection string going to a mdb, the query looks correct to me and I know that the data stored in the table exists but when I run the query in my code it says: No data exists for the row/column.
[Code]....
It has crossed my mind that perhaps the way the data is put into the program is not compatible with the data in the database, I don't know if that is a valid thought though.
View 3 Replies
Nov 24, 2010
Inside an UpdatePanel a Gridview will be filled with data (AutoGenerateColumns=true). The data will be different each time (coming from different database tables) - if the corresonding DataTable contains a specific column (identified by name) I know that the datatype is "Xml". In this case I don't want to show the content, I want to add a button instead. And if the user clicks this button a new browser window should be opened to show the xml-data.
Therefore in the "RowDataBound"-event I added a button to the corresponding Tablecell. This works but I don't get the click-event of this button (I get also no "RowCommand"-event when working with command name). It only "refreshes" the UpdatePanel I guess (because instead of the button, after the click I get the original xml-data in the TableCell because "RowDataBound" will not be fired).
What I need is the following:
- AutogenerateColumns= true
- Adding in a specific column a button instead of the xml-text
- An event, where I can identify which row was sender of the click so that I can show the xml-data in a seprate browser window.
View 5 Replies
Apr 15, 2010
I have a datagrid that is supposed to display the list of uploaded word doc containing a specific word , this sort by the one having the greatest number of occurences(relevance).
It should allow the user to download one of the file by clicking on the button column .But im unable to get the text appearing in the datagrid nor the one in the button column
these are the table column
Firstname,Lastname,Path and Relevance
This is the code on item command:
[Code]....
the datagrid code:
<asp:DataGrid ID="DataGrid1" runat="server" AllowPaging="True"
BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px"
CellPadding="4" ForeColor="Black" GridLines="Vertical" ShowFooter="True"
AutoGenerateColumns="False" onitemcommand="DataGrid1_ItemCommand"
Width="353px">
<FooterStyle BackColor="#CCCC99" />
<SelectedItemStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right"
Position="TopAndBottom" />
<AlternatingItemStyle BackColor="#6699FF" Font-Bold="False" Font-Italic="False"
Font-Overline="False" Font-Strikeout="False" Font-Underline="False" />
<ItemStyle BackColor="#F7F7DE" />
<Columns>
<asp:BoundColumn DataField="firstName" HeaderText="FirstName" ReadOnly="True">
</asp:BoundColumn>
<asp:BoundColumn DataField="lastName" HeaderText="LastName" ReadOnly="True">
</asp:BoundColumn>
<asp:ButtonColumn CommandName="getCv" DataTextField="Path" HeaderText="Cv"
Text="Path"></asp:ButtonColumn>
<asp:BoundColumn DataField="NumberOfOccurences" HeaderText="Relevance">
</asp:BoundColumn>
</Columns>
<HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
</asp:DataGrid>
May i know how to get the value of the button column been click?
View 2 Replies
May 30, 2010
I have a gridview with a button field and a select field, The select field does what is supposed to do on gridview selected event, but how do i tell it to do something different if the button field is selected.
View 2 Replies
Mar 19, 2010
I want to show student attendance report on grid view with present and absent facilty using two radio butons on seprate column.Now i want user can select either present or absent radio button.I tried so much but i failed every time
View 3 Replies
Sep 2, 2010
I don't want to use the built in "Select" hyperlink that's in the gridview, I'd like to just use the first data column, is there a way to do that or are we forced to use the automatically generated "Select" column.
View 5 Replies
Jul 29, 2010
I am using ASPNET2008 with VB Scripting and not C# Scripting I am encountering new problem.
On the WebFrm1, I just don't know how to write the coding to retrieve the CUSTOMERID data in order to retrieve the details from SQL SERVER table to fill the textbox controls.Here is the decription of the GRIDVIEW column
In the GRIDVIEW1 on the left edge one of the column is SELECT button which let the userclick on it to select the specific CUSTOMERID on the column next to it on the right.
Here are the coding from SOURCE
<asp:ButtonField ButtonType="Button" Text="Select" CommandName="SelectClick" DataTextField="CustomerID" >
</asp:ButtonField>
View 10 Replies
Sep 21, 2010
How can i move the RESET button inside sort order column , so that my code doesnot break?
[Code]....
View 3 Replies
May 12, 2010
can we dispalay autogenerated edit button column at a desired location in gridview columns?
View 3 Replies
Mar 24, 2010
i am working with a gridview and created it in following way:
[Code]....
Now i want to remove the Select, Edit and Delete link buttons in the last columns for a particular row. It should remain as it is for other rows. Only linkbutton from a particular row(being determined from data key) is to be removed.
View 12 Replies
Nov 12, 2010
How to change a column from hyperlink field to button in Gridview?
My current code is as follows
<asp:TemplateField HeaderText="Click">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl='<%# Eval("ID", "Detail.aspx?ID={0}") %>'
Target="_blank" Text="Detail"></asp:HyperLink>
</ItemTemplate>
<EditItemTemplate>
</EditItemTemplate>
</asp:TemplateField>
View 6 Replies
Jan 13, 2010
I have been trying to get a Gridview of a list of usernames and passwords for site login that the Edit button would be disabled if one of the columns had a certain word in it?
For now, I need the Edit button to be disabled if the Username for a record is "admin". Is there a way to do this? My current code is here:
[Code]....
View 15 Replies
Dec 15, 2010
Show/Hide Edit button depending on column value?
View 3 Replies
Jan 17, 2010
I have a gridview, which contains a template field with a button. On this button, I want to show and hide another column with this one button. I don't want to use Java Script because my site already uses a lot of this and AJAX. So, can someone show an example of some code behind, which is what I want to do on how to show and hide another column on a gridview?
View 1 Replies
Jan 19, 2010
I have a grid view that works great but I need to add a new column in the behind code. I know you can do it in the aspx page but i want to manual populate in the CS file. How do I add a radio button column that will past the ID to a new page? This is what my code looks like so far:
[Code]....
View 2 Replies