when I fire the Edit/Update from the EditCommandColumn. I have set a
few attributes such as:
Dim tbPhone As TextBox = CType(e.Item.Cells(4).Controls(0), TextBox)
tbPhone.BorderStyle = BorderStyle.Solid
tbPhone.BorderWidth.Pixel(1)
tbPhone.Font.Name = "Tahoma"
When I run the application and click 'Edit' the attributes above are
not reflected in the textbox. They (textboxes) resort back to their
clunky default attributes.
Any suggestions?Will Lastname wrote:
> I am trying to manipulate the textbox properties in my datagrid for
> when I fire the Edit/Update from the EditCommandColumn. I have set a
> few attributes such as:
> Dim tbPhone As TextBox = CType(e.Item.Cells(4).Controls(0), TextBox)
> tbPhone.BorderStyle = BorderStyle.Solid
> tbPhone.BorderWidth.Pixel(1)
> tbPhone.Font.Name = "Tahoma"
> When I run the application and click 'Edit' the attributes above are
> not reflected in the textbox. They (textboxes) resort back to their
> clunky default attributes.
> Any suggestions?
My guess is that the attributes of the textbox are getting changed after
the textbox has already rendered. I would try applying the styles
before the textboxes render, such as in the OnItemDataBound event.
--
Rob Schieber
Thanks for the reply Rob. I will give this a whirl.
--
"Our enemies are innovating and resourceful, and so are we. They never
stop thinking of ways to harm our country and our people, and neither do
we." President George W. Bush
*** Sent via Developersdex http://www.developersdex.com ***
Will Chamberlain wrote:
> Thanks for the reply Rob. I will give this a whirl.
> --
> "Our enemies are innovating and resourceful, and so are we. They never
> stop thinking of ways to harm our country and our people, and neither do
> we." President George W. Bush
> *** Sent via Developersdex http://www.developersdex.com ***
No problem. One thing to remember when doing this is to make sure you
are using the right ItemType within the event.
void OnItemDataBound(object sender, DataGridItemEventArgs e)
{
if(e.ItemType == EditItem)
{
do stuff...
}
}
--
Rob Schieber
0 comments:
Post a Comment