Click here to Skip to main content
15,909,039 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Gif image Pin
Vimalsoft(Pty) Ltd29-Jul-09 21:44
professionalVimalsoft(Pty) Ltd29-Jul-09 21:44 
QuestionDynamic Menu Pin
blainzaw29-Jul-09 20:11
blainzaw29-Jul-09 20:11 
AnswerRe: Dynamic Menu Pin
Rajeshwar Code- Developer29-Jul-09 21:33
Rajeshwar Code- Developer29-Jul-09 21:33 
GeneralRe: Dynamic Menu Pin
blainzaw29-Jul-09 23:05
blainzaw29-Jul-09 23:05 
QuestionPrinting gridview Pin
sonalee230429-Jul-09 19:10
sonalee230429-Jul-09 19:10 
AnswerRe: Printing gridview Pin
Viral Upadhyay29-Jul-09 19:27
Viral Upadhyay29-Jul-09 19:27 
GeneralRe: Printing gridview Pin
sonalee230430-Jul-09 1:34
sonalee230430-Jul-09 1:34 
QuestionDisable a button in DataGrid by using ItemDataBound event Pin
AndieDu29-Jul-09 19:00
AndieDu29-Jul-09 19:00 
Dear All,

I am having a datagrid with Edit, Update, and Delete button columns and bound columns on my asp.net form, what i want to do is that when there is a value in a datagrid cell, then disable the Delete button.

For example:
if there is a value in DateReceived cell, the Delete button on that data row will be disabled, and if there is no value in DateReceived cell, the Delete button on that data row will be enabled.

I knew that i might need to use DataGrid ItemDataBound event, the following code disable the Delete button unless the Edit button been clicked, but this is not what i want.

private void dgrOrders_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
DataGridItem dgi = e.Item;
if ((dgi.ItemType == ListItemType.Item) || (dgi.ItemType == ListItemType.AlternatingItem))
{
LinkButton lb = (LinkButton)e.Item.Cells[11].Controls[0];
if (lb != null && lb.CommandName.Equals("Delete"))
{
lb.Enabled = false;
}
}
}

Can someone please shed a light in here for me, thanks heaps.

Andie
QuestionCalling a serverside method by __doPostBack()? Pin
Tridip Bhattacharjee29-Jul-09 18:52
professionalTridip Bhattacharjee29-Jul-09 18:52 
AnswerRe: Calling a serverside method by __doPostBack()? Pin
Viral Upadhyay29-Jul-09 18:59
Viral Upadhyay29-Jul-09 18:59 
AnswerRe: Calling a serverside method by __doPostBack()? Pin
amitabha12331-Jul-09 0:41
amitabha12331-Jul-09 0:41 
QuestionProblem in adding a gif image Pin
janani1329-Jul-09 18:43
janani1329-Jul-09 18:43 
QuestionDynamically set iframe height and width Pin
syaiful_8629-Jul-09 17:29
syaiful_8629-Jul-09 17:29 
Questionselect a value from dropdownlist, textbox will populate corresponding to that value in dropdownlist Pin
haleemasher29-Jul-09 17:26
haleemasher29-Jul-09 17:26 
AnswerRe: select a value from dropdownlist, textbox will populate corresponding to that value in dropdownlist Pin
Blue_Boy29-Jul-09 20:45
Blue_Boy29-Jul-09 20:45 
Questiondisplaying controls [modified] Pin
soorma29-Jul-09 12:31
soorma29-Jul-09 12:31 
QuestionLink Button Event Handler Pin
Ersan Ercek29-Jul-09 11:05
Ersan Ercek29-Jul-09 11:05 
AnswerRe: Link Button Event Handler Pin
Christian Graus29-Jul-09 11:10
protectorChristian Graus29-Jul-09 11:10 
GeneralRe: Link Button Event Handler Pin
Ersan Ercek29-Jul-09 22:33
Ersan Ercek29-Jul-09 22:33 
QuestionPolymorphism Pin
BhavinBhatt29-Jul-09 8:04
BhavinBhatt29-Jul-09 8:04 
AnswerRe: Polymorphism Pin
Not Active29-Jul-09 9:50
mentorNot Active29-Jul-09 9:50 
GeneralRe: Polymorphism Pin
BhavinBhatt30-Jul-09 21:40
BhavinBhatt30-Jul-09 21:40 
GeneralRe: Polymorphism Pin
Not Active30-Jul-09 23:32
mentorNot Active30-Jul-09 23:32 
GeneralRe: Polymorphism Pin
BhavinBhatt31-Jul-09 21:11
BhavinBhatt31-Jul-09 21:11 
Question.net applications Pin
shankarbuddhi29-Jul-09 6:46
shankarbuddhi29-Jul-09 6:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.