Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Editing data

Reply
Thread Tools

Editing data

 
 
et
Guest
Posts: n/a
 
      04-22-2006
When a user clicks on the Edit button in a grid, is there a way to force
certain fields to be blank instead of displaying the data?





 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      04-22-2006
Hi,

I'd think that if you'd handle ItemDataBound (or RowDataBound in GridView)
and in that check if ItemType is EditItem (in GridView RowState =
DataControlRowState.EditRow), you could search the control(s) from the row
and blank it yourself. (Row|ItemDataBound happens after row is being
databound so you can affect the outcome of it at this point)

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"et" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> When a user clicks on the Edit button in a grid, is there a way to force
> certain fields to be blank instead of displaying the data?
>
>
>
>
>



 
Reply With Quote
 
 
 
 
KatMagic
Guest
Posts: n/a
 
      04-24-2006
I have tried this too and can't find the syntax to blank it out (I'm not on
ASP 2.0):
In ItemDataBound, If the itemtype = EditItem, I tried
e.Item.Cells(7).Controls(3). ???
There is no text or value property. I can enable it or disable it and I
can't disable it because I want them to enter data.

"Teemu Keiski" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I'd think that if you'd handle ItemDataBound (or RowDataBound in GridView)
> and in that check if ItemType is EditItem (in GridView RowState =
> DataControlRowState.EditRow), you could search the control(s) from the row
> and blank it yourself. (Row|ItemDataBound happens after row is being
> databound so you can affect the outcome of it at this point)
>
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
> http://blogs.aspadvice.com/joteke
>
> "et" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> When a user clicks on the Edit button in a grid, is there a way to force
>> certain fields to be blank instead of displaying the data?
>>
>>
>>
>>
>>

>
>



 
Reply With Quote
 
Teemu Keiski
Guest
Posts: n/a
 
      04-30-2006
It's much easier to look for the control with e.Item.FindControl where you
can look for the control with the ID. You woin't need to know the order of
the controls in that case (and code won't break when layout changes)

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"KatMagic" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>I have tried this too and can't find the syntax to blank it out (I'm not on
>ASP 2.0):
> In ItemDataBound, If the itemtype = EditItem, I tried
> e.Item.Cells(7).Controls(3). ???
> There is no text or value property. I can enable it or disable it and I
> can't disable it because I want them to enter data.
>
> "Teemu Keiski" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hi,
>>
>> I'd think that if you'd handle ItemDataBound (or RowDataBound in
>> GridView) and in that check if ItemType is EditItem (in GridView RowState
>> = DataControlRowState.EditRow), you could search the control(s) from the
>> row and blank it yourself. (Row|ItemDataBound happens after row is being
>> databound so you can affect the outcome of it at this point)
>>
>> --
>> Teemu Keiski
>> ASP.NET MVP, AspInsider
>> Finland, EU
>> http://blogs.aspadvice.com/joteke
>>
>> "et" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> When a user clicks on the Edit button in a grid, is there a way to force
>>> certain fields to be blank instead of displaying the data?
>>>
>>>
>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Are you looking for high quality photo editing and video editing? gwanglu@gmail.com C Programming 0 07-19-2006 12:32 PM
Re: Two questions about editing data in DataGrid control Greg Burns ASP .Net 1 10-03-2004 01:32 PM
Re: Editing Datagrid with xmlDocument data source S. Justin Gengo ASP .Net 2 08-26-2003 08:43 PM
How can i get the previous value of a control when editing a data grid? Blake Versiga ASP .Net 1 08-13-2003 03:16 AM
Data Grid Editing Validation Nilay Shah ASP .Net 0 07-03-2003 03:43 PM



Advertisments