Web hosting
ultimate web hosting guide
Webmaster Talk
For Web Hosts
:
Log on to your account
|
Add Your Hosting Company
Home
Shared Hosting
ASP.Net Web Hosting
PHP mySQL Web Hosting
MS SQL Server Database Hosting
Free Web Hosting
Cheap Web Hosting
Budget Web Hosting
RVSkin Web Hosting
Fantastico Web Hosting
Website Builder Hosting Plans
Ecommerce Hosting Plans
Dedicated Servers
Managed Dedicated Server Hosting
UnManaged Dedicated Server Hosting
Cheapest Dedicated Server Hosting
VPS
Cheap VPS Server Hosting
Windows VPS Server Hosting
CPanel VPS Server Hosting
Plesk VPS Server Hosting
ColdFusion VPS
Unlimited Domains VPS Hosting Plans
DotNetPanel VPS
Knowledgebase
Forum
Web Hosting Discussion Forum
>
Web Hosting Business Discussion Forum
>
Technical and Security Issues Discussion Forum
example of editing in DataGrid and Default Paging
User Name
Remember Me?
Password
Register
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
LinkBack
Thread Tools
Search this Thread
Display Modes
#
1
(
permalink
)
October 5th, 2007, 02:34 PM
jason
Administrator
Join Date: Aug 2007
Posts: 190
example of editing in DataGrid and Default Paging
This is an example of editing in DataGrid and Default Paging Html Design Code : - Code (EditInDataGrid.aspx.cs) : private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here if(!IsPostBack) { BindGrid(); } } private void DataGrid1_EditCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { DataGrid1.EditItemIndex = e.Item.ItemIndex; BindGrid(); } private void BindGrid() { SqlDataAdapter da = new SqlDataAdapter("select id,name from category",con); DataSet objDS = new DataSet(); try { da.Fill(objDS,"Cat"); if(objDS.Tables[0].Rows.Count != 0) { DataGrid1.DataSource = objDS; DataGrid1.DataBind(); } else { DataGrid1.DataSource = null; DataGrid1.DataBind(); Response.Write("No record found."); } } catch(Exception ex) { throw ex; } } private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { try { string strCatName = ((TextBox)e.Item.FindControl("txtEdit")).Text; string strId = DataGrid1.DataKeys[e.Item.ItemIndex].ToString(); SqlCommand com = new SqlCommand("update category set name ='"+strCatName+"' where id = "+strId,con); con.Open(); com.ExecuteNonQuery(); DataGrid1.EditItemIndex = -1; BindGrid(); } catch(Exception ex) { throw ex; } } private void DataGrid1_CancelCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { DataGrid1.EditItemIndex = -1; BindGrid(); } private void DataGrid1_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEvent Args e) { DataGrid1.CurrentPageIndex = e.NewPageIndex; BindGrid();
More...
__________________
List of
Premium Windows VPS Hosting
Providers.
Find
Affordable VPS Hosting Providers
-
Starts @ $4 /month only
.
TheWebHostingDir.Com - A
Premium Web Hosting Directory
.
#
2
(
permalink
)
May 5th, 2008, 09:50 AM
fyz
Junior Member
Join Date: May 2008
Posts: 6
Aha, this is useful.
«
Previous Thread
|
Next Thread
»
Currently Active Users Viewing This Thread: 1
(0 members and 1 guests)
Thread Tools
Search this Thread
Show Printable Version
Email this Page
Search this Thread
:
Advanced Search
Display Modes
Linear Mode
Switch to Hybrid Mode
Switch to Threaded Mode
Posting Rules
You
may not
post new threads
You
may not
post replies
You
may not
post attachments
You
may not
edit your posts
BB code
is
On
Smilies
are
On
[IMG]
code is
On
HTML code is
Off
Trackbacks
are
On
Pingbacks
are
On
Refbacks
are
On
Forum Rules
Contact Us
-
The Web Hosting Directory
-
Archive
-
Top
Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by
vBSEO
3.5.0 RC2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26