5 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 15 May 2009, 06:49 AM
Hello,
I guess you want to add a label (with Text as %) beside the textbox which is in edit mode. Try out the following code snippet.
CS:
Thanks,
Shinu.
I guess you want to add a label (with Text as %) beside the textbox which is in edit mode. Try out the following code snippet.
CS:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridEditableItem && e.Item.IsInEditMode) |
{ |
GridEditableItem dataItem = e.Item as GridEditableItem; |
Label lbl = new Label(); |
lbl.Text = "%"; |
dataItem["CategoryID"].Controls.Add(lbl); //CategoryID is the columnUniqueName |
} |
} |
Thanks,
Shinu.
0
Mr
Top achievements
Rank 1
answered on 15 May 2009, 08:32 AM
thanks you
but it still don't Add text % after textbox when edit it
please help me
thanks
but it still don't Add text % after textbox when edit it
please help me
thanks
0
Mr
Top achievements
Rank 1
answered on 15 May 2009, 08:45 AM
sorry
thanks you
yes. i have do it
thanks you
yes. i have do it
0
Mr
Top achievements
Rank 1
answered on 16 May 2009, 07:28 AM
but, in event UpdateCommand. how can i get control Label?
i write same bellow
protected void RadUpdateResource_UpdateCommand(object source, GridCommandEventArgs e)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
Lable Newlbl = (Label)editedItem["category"].FindControl("lbl");
}
but Newlbl = null
please help me
thanks
i write same bellow
protected void RadUpdateResource_UpdateCommand(object source, GridCommandEventArgs e)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
Lable Newlbl = (Label)editedItem["category"].FindControl("lbl");
}
but Newlbl = null
please help me
thanks
0
Princy
Top achievements
Rank 2
answered on 19 May 2009, 09:42 AM
Hi,
Try adding the Label in ItemCreated event instead of ItemDataBound (including specifying the ID for Label) so that you can access it from UpdateCommand event.
CS:
Thanks,
Princy.
Try adding the Label in ItemCreated event instead of ItemDataBound (including specifying the ID for Label) so that you can access it from UpdateCommand event.
CS:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridEditableItem && e.Item.IsInEditMode) |
{ |
GridEditableItem dataItem = e.Item as GridEditableItem; |
Label lbl = new Label(); |
lbl.ID = "Label1"; |
lbl.Text = "%"; |
dataItem["CategoryID"].Controls.Add(lbl); |
} |
} |
protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e) |
{ |
GridEditableItem editedItem = e.Item as GridEditableItem; |
Label Newlbl = (Label)editedItem["CategoryID"].FindControl("Label1"); |
} |
Thanks,
Princy.