C# - Passing Through A Datagrid Value?

Dec 26, 2010

I have a datagrid with 2 columns.

One databound which display names and the other one is a hyperlink column.

Column1 = databound column, Column2 = hyperlink column.

column1: column2:
---------------------
Name1 Modify
Name2 Modify

Next when i click on any of the values in Column2 i simply get redirected to a other page.

This page contains 2 buttons/hyperlinks with Yes or No. (does not mather wich control, which one would bring the most easy to implement solution atm)

When clicked on No it simply redirects back to the orignal page.

Now the question is when i press "Yes" how exactly do i acces "Name1" (or Name2 if i press on the second modify)?

Meaning if i press Yes i want to use this Name for certain opertions (xml).

To put it short if i press on "modify" i want to be able to get that name associated with it (which is already displayed in the first bound column left of it).

So the goal is to use that name in Xpath for example so i can make a query towards that node with that certain name.

View 2 Replies


Similar Messages:

Forms Data Controls :: Selecting A Row In An Datagrid And Passing A Value Related To Selected Row On Button Click?

Nov 5, 2010

I have a datareader that returns a few fields (orderid, customer id, customername, location, total amount - as an example) that is bound to a datagrid on an asp page. The datagrid simply displays customername, location and total amount and has 2 buttons

below it labelled 'Add New' and 'Edit' and I would like the following to happen:

1) when a user clicks on any cell in the datagrid, I want that row to be highlighted in someway so that the user is aware of the highlighted row.

2) If the user then clicks on Edit button, I want to go to another page that displays the details of that order by passing the orderid of that row to the next page.

The idea is that the user selects a row on the datagrid and then clicks edit which will take them to another page where they can edit/updated details but I'm not sure how I can pass a value of a selected row in a datagrid to another page. I am aware that you can add a template column with buttons on but I would like to have one set of buttons rather than have buttons on each row of the datagrid.

View 3 Replies

Forms Data Controls :: How To Filter Child Datagrid On Parent Datagrid Row Select

Apr 6, 2010

I have 2 grids gvParent & gvChild I would like to filter gvChild when a row is selected in gvParent the linking fields are contractNo

I added a column for selecting:

<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Select"
OnClick="LinkButton1_Click" Text="Select"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>

I know how to handle the filtering of the grid (create a criteria and set to rowfilter of the dataview) But, I dont know how to get the value of the column of the selected row.

View 5 Replies

Forms Data Controls :: Want To Capture - Datagrid On Clcik On Datagrid Row Value Using C#?

Mar 4, 2011

I have Datagrid , i want to clcik on row and get data in textbox , but my textbox is FreeTextBox control,i tried to use javascript but work for asp.net control not working for freetext box control, how i can capture this code is sample code but it work for asp.net control but not working for my freetextbox

[Code]....

View 1 Replies

Forms Data Controls :: How To DataGrid SelectIndex Inside A DataGrid

Sep 22, 2010

Simply put... I want to duplicate the example found at this link, in VB.net rather than C#.

[URL]

I would like the selectedvalue of the dropdown to display additional data base on its selection in multiple text boxes.

I have tried using the DropDownList OnSelectedIndexChanged property, within a DataGrid EditiItemTemplate, but I cannot retrieve data from the selection. (AutoPostBack is "True"). I can however use a button onclick event to fire a "prre-defined" selection value.

View 2 Replies

C# - How To Access A Child Datagrid Which Is Inside Of Another Datagrid, Before It's Not Binded

Jun 23, 2010

I have a nested datagrid. I want to get header texts of child datagrid, bifore binding process.

Is there a way to do this?

View 1 Replies

Forms Data Controls :: How To Find DataGrid Row From Another DataGrid

May 27, 2010

I have 2 datagrid (using .net 1.1). I need to access column of second grid ( i need to make a column of second grid as disabled) when i click "Cancel" link button in First Grid. How can this be done?

View 7 Replies

Web Forms :: How To Assign Values Of Data Table To A Datagrid When Datagrid Has Data List And Text Boxes

Jan 8, 2010

I had called the data from query to data table and now i have a gridview in which i am using one datalist and 2 text boxes and and reming coloumns are bounded iahve to assiaign them values which datatable have either null or any value.

View 2 Replies

Forms Data Controls :: Datagrid With Column Choose To Choose Columns Dynamically Using DataGrid With Object Data Sour

Sep 30, 2010

I have "Order" object with Columns Ticket,OTP and CustomerName etc.Intially on DataGrid, I'm binding Ticket only , when user clicks on "Column Chooser" button, another windows appears to pickup CustomerName,OTP columns to add specified column dynamically on Datagrid. Environment : Asp.net ,C# with Object Data source

Public Class Order
{
publc void Order()
{
}
public string Ticket
{
get
{
return this.strTicket;
}
set
{
this.strTicket = value;
}
}
public string OtpNumber
{
get
{
return this.strOtpNumber;
}
set
{
this.strOtpNumber = value;
}
}
public string CustomerName
{
get
{
return this.strCustomer;
}
set
{
this.strCustomer = value;
}
}
}
}

View 1 Replies

How To Get All Values From Datagrid

Aug 2, 2010

I am using DataGrid, Now I want to know to get all values from that Datagrid. How can I acheive.

View 2 Replies

VS 2008 Another DataGrid ?

Jul 15, 2010

This is my Table structure:I did this in vb.net and this code displayed the images in the DataGrid:

Code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If IsPostBack = False Then

but when i am doing the same code in C#;then its not working:
[code]....

Code:
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
[code]....

View 31 Replies

Using Check Box On Datagrid?

Jun 3, 2010

I am using a datagrid in my website project and be using the select option available i have got the check box options on my datagrid.know how exactly can i retrieve the field say primary key on the table respective to the checked fields.

View 2 Replies

Add A 2nd Header To A DataGrid?

Aug 17, 2010

Is there a way to add a 2nd header row to a DataGrid? In the row I want a DropdDownList and a Label. Right now I have a BoundColumn and a TemplateColumn in my Columns section of the grid. But adding something here will only add column, but not a header.

It should look like this:

This is my label text: dropdownlist --> first row of header

Amount Link --> 2nd row of header
100 link1
200 link2

How could I do this?

View 1 Replies

Asp.net - Use For A Datagrid With A Lot Of Data?

Oct 19, 2010

Found this interesting interview question:You need to display the sales data for your division for the past 5 years in a DataGrid on a Web Form. Performance is very important. What would be the best strategy to use in retrieving the data?

[code]...

View 4 Replies

How To Retrieve Record Into Datagrid

Aug 5, 2010

[code]....

i am using asp.net and datagrid i want to show record on datagrid with 3 column but data will be unlimited i want to show record data into datagrid

my table name is user_detail and fields are User_name.Name,Passwordwell i m confussed i m using vb6 which i use recordset in replacement in asp.nety wht i use using access.

View 1 Replies

VS 2005 With Datagrid Events

Jan 28, 2010

i am developing a small asp.net application in vs 2005. my application consists of 3 layers.presentation, business layer and data layer. now i got a small problem in using datagrid events like itemcommand , databound events in presentation layer. this is my first asp.net application with different layers , upto now i dint work with layers. i created datagrid as follows <asp:datagrid id="datagrid1" runat="server" /> in my page load i craeted an instance for my businesslayer as mywebsite businesslayer .customerinfo cs = new mywebsite businesslayer .customerinfo(); in customer info i have a function to bind the grid

bindgrid(datagrid dg1, datatable dt)
{
dg1.datasource=dt;
dg1.databind();
}

now i want to add itemcommand event ad databound events. can any one advice me how to add these events and where should i have to add these events?

View 5 Replies

Is There Id In The Datagrid Template Columns

Aug 4, 2010

i want to create dynamically inside a datagrid templatecolumn some buttons and i wonder how can i refer to them from the vb code..

View 9 Replies

How To Compare A Row And Column In A Datagrid Using C#

Oct 8, 2010

I have 2 datsets named ds and ds1 and merged that datasets into a single table named dt. Now, i want to compare the first dataset row value with second dataset column values For Ex: 1 dataset row contains the value as "SriDevi" means, i want to compare and find how many times the value "SriDevi" appears in second dataset columns and count the appearance. And give the answer as the "count".

[code]....

View 1 Replies

Datagrid In Edit Mode?

Jan 19, 2010

I have an editable datagrid. In debug mode, the page works just fine. Outside of debug mode, when I edit a row in the datagrid and click edit button page just refreshes, not debug datagrid

View 10 Replies

How To Show The Textbox2 Then A The Last Row Of The Datagrid

Jan 28, 2010

[code]....

but when i run then i cant find the textbox2 at the end of the databound. i.e,at the last row of the datagrid....

how to show the textbox2 then a the last row of the datagrid?

i want to show this in order to provide the user with data insertion facility.

View 27 Replies

Want To Have A Header Text In A Datagrid?

Aug 25, 2010

i want to have a header text in a datagrid but i dont want the text to belong only to one column of the grid but to the hole grid i mean i want the text to be writen in the hole place over the columns and not only over a specific column i dont know if i am clear..how can be that done??

View 11 Replies

C# - Bind Datagrid To Collection?

Jan 20, 2010

how do I bind a DataGrid to a collection? (e.g : List ). i used this :

Datagrid dg = new Datagrid();
dg.DataSource = myCollection;
dg.DataBind();

but after this, the Datagrid still doesn't display the data from the collection.

View 5 Replies

Mvc - Bind DataGrid To Dictionary In C#?

May 6, 2010

I end up with a row for each object in the list, and any cell in a given row is bound to a property of the corresponding object.

However, suppose one of the properties of my object is a dictionary, and each is expected to contain a specific key. Is there any way to bind one of my DataGridColumns to that dictionary key?

View 3 Replies

Clickable Items In Datagrid

Jan 4, 2010

I'd like to write a code that would allow a user clicking on a selected item in a datagrid view table (for example a Name from People_datatable) and navigate to another page whit a datagrid of personal data filtered by Name.

View 4 Replies

C# - Deleting Items From Datagrid (xml)?

Dec 25, 2010

I have a datagrid buttoncolumn which acts as delete buttons for my xml nodes. The elements are simply displayed in a boundcolumn, so there names get displayed.

Each item generated gets a unique id (each time one is made id+++). My question his how can i remove a item (the entire element node with that certain id) when i click on one of the buttons in the bound column?

[Code]....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved