473,416 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

CANT see EDIT UPDATE CANCEL Buttons for DATAGRID

Hi,

I have an ASP.NET application using C# code. I am using a datagrid to
display records from a database based on a user input, i.e a user enters a
compnay name in text box & when he clicks a "Submit" button, only those
records are displayed where company name matches with user input.

I need the datagrid to be editable. For this i used the walkthrough from
..NET "Using a datagrid for reading & writing data to database" or it was some
similar name.
This code works fine when the datagrid shows all records but for the data
grid which shows only the records based on user input, this walkthrough
doesnt work. I think its bcoz i fill the dataset on "Submit" button click
rather than on page load. So when I hit the submit button after entering
Company name, I get to view records of that company. But WHEN I HIT the EDIT
LINK NEXT TO THE RECORD , I DONT SEE EDIT, UPDATE & CANCEL BUTTONS. I can
ONLY see those buttons when I hit submit again!!!

How to get over this?

--
pmud
Nov 19 '05 #1
3 2259
Yes, your idea is likely. Move the code that fills the dataset to its own
routine and call from the button click. Call again from the EDIT postback
routine just prior to asking for a particular edit column. If not, you will
get either a) nothing or b) whatever is "cached" in viewstate.
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"pmud" wrote:
Hi,

I have an ASP.NET application using C# code. I am using a datagrid to
display records from a database based on a user input, i.e a user enters a
compnay name in text box & when he clicks a "Submit" button, only those
records are displayed where company name matches with user input.

I need the datagrid to be editable. For this i used the walkthrough from
.NET "Using a datagrid for reading & writing data to database" or it was some
similar name.
This code works fine when the datagrid shows all records but for the data
grid which shows only the records based on user input, this walkthrough
doesnt work. I think its bcoz i fill the dataset on "Submit" button click
rather than on page load. So when I hit the submit button after entering
Company name, I get to view records of that company. But WHEN I HIT the EDIT
LINK NEXT TO THE RECORD , I DONT SEE EDIT, UPDATE & CANCEL BUTTONS. I can
ONLY see those buttons when I hit submit again!!!

How to get over this?

--
pmud

Nov 19 '05 #2
BG
i agree. however, if you need to update the datagrid on page_load, you need
to do the following otherwise you will be running in circles.

void Page_Load(){
if(!Page.IsPostBack){
//put your function here
}
}

hope this helps.
bg

"Cowboy (Gregory A. Beamer) - MVP" wrote:
Yes, your idea is likely. Move the code that fills the dataset to its own
routine and call from the button click. Call again from the EDIT postback
routine just prior to asking for a particular edit column. If not, you will
get either a) nothing or b) whatever is "cached" in viewstate.
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"pmud" wrote:
Hi,

I have an ASP.NET application using C# code. I am using a datagrid to
display records from a database based on a user input, i.e a user enters a
compnay name in text box & when he clicks a "Submit" button, only those
records are displayed where company name matches with user input.

I need the datagrid to be editable. For this i used the walkthrough from
.NET "Using a datagrid for reading & writing data to database" or it was some
similar name.
This code works fine when the datagrid shows all records but for the data
grid which shows only the records based on user input, this walkthrough
doesnt work. I think its bcoz i fill the dataset on "Submit" button click
rather than on page load. So when I hit the submit button after entering
Company name, I get to view records of that company. But WHEN I HIT the EDIT
LINK NEXT TO THE RECORD , I DONT SEE EDIT, UPDATE & CANCEL BUTTONS. I can
ONLY see those buttons when I hit submit again!!!

How to get over this?

--
pmud

Nov 19 '05 #3
Hi Gregory,

For updating the SQL database using data grid , is primary key required? I
dont have a primary key in the SQl table. Is it possible to do the same
thing if I dont want to make a primary key ???

"Cowboy (Gregory A. Beamer) - MVP" wrote:
Yes, your idea is likely. Move the code that fills the dataset to its own
routine and call from the button click. Call again from the EDIT postback
routine just prior to asking for a particular edit column. If not, you will
get either a) nothing or b) whatever is "cached" in viewstate.
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"pmud" wrote:
Hi,

I have an ASP.NET application using C# code. I am using a datagrid to
display records from a database based on a user input, i.e a user enters a
compnay name in text box & when he clicks a "Submit" button, only those
records are displayed where company name matches with user input.

I need the datagrid to be editable. For this i used the walkthrough from
.NET "Using a datagrid for reading & writing data to database" or it was some
similar name.
This code works fine when the datagrid shows all records but for the data
grid which shows only the records based on user input, this walkthrough
doesnt work. I think its bcoz i fill the dataset on "Submit" button click
rather than on page load. So when I hit the submit button after entering
Company name, I get to view records of that company. But WHEN I HIT the EDIT
LINK NEXT TO THE RECORD , I DONT SEE EDIT, UPDATE & CANCEL BUTTONS. I can
ONLY see those buttons when I hit submit again!!!

How to get over this?

--
pmud

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Alex | last post by:
Interested in more .NET stuff visit www.dedicatedsolutions.co.uk The DataList is not as powerful as the DataGrid. It requires more work from you since it has no default data presentation format....
4
by: DC | last post by:
Newbie's question about .NET datagrid If I use: <asp:EditCommandColumn></asp:EditCommandColumn> When I edit a row, it will automatically show Update and Cancel Link. But when I use:...
1
by: Chris Brandsma | last post by:
I'm thinking this is simple, but... I added an Edit/Update/Cancel column to a DataGrid. Any time I hit the edit/Update/Cancel button the grid returns blank (no rows returned but the header and...
0
by: Steve Kallal | last post by:
I have a DataGrid with an EditCommandColumn column set to a type of PushButton. I want to set set CssClass on these buttons and cannot without using code-behind code on the ItemDataBound event. The...
4
by: rkbnair | last post by:
Is there any way to display an image button instead of the traditional Edit/Update/Cancel push button in a datagrid (with bound data)?
1
by: rp13 | last post by:
Hi, I am using a asp:datagrid which is editable. Though I have handlers wired to my edit, update & cancel events, some how when i click on the edit button nothing happens. The edit template...
0
by: bh | last post by:
I'm trying to edit data in a datagrid through a dropdown list with different id/text values. The problem comes in when I click the edit button & nothing appears to be happening. Did I do...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
2
by: slinky | last post by:
I had a successfully deployed datagrid reading an XML file and showing the data: Private Function MakeDataView() as DataView Dim myDataSet As New DataSet()...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.