On Jun 7, 11:37 am, Alexey Smirnov <alexey.smir...@gmail.comwrote:
On Jun 7, 6:14 pm, c_shah <shah.chi...@netzero.netwrote:
Alexy, thank you.
I have another question. I would appreciate if you can answer my
question.
ItemTemplate of a repeater has two checkboxes and a label. (each
checbox is an option) and label control will display price. if one or
both the checkboxes is checked price need to be updated on the lable.
solution you proviced will not as I bound repeater with a datasset
(few rows) So for each row in my dataset i have have two checkboxes
and a label.
each row will have checkboxes and price label
i only want to update label (for which checkbox is checked)..
I guess I have to iterate through the number of items bound to
repeater and find out which row is checked and update label for that
item
any code help
What's the purpose of that repeater? Using the CheckedChanged event
you will postback the page each time. If you don't update the
datasource the postback makes no sense for me. If the label depends on
checkboxes only, you can change its text using a client js. Otherwise
you have to iterate through the items, I think- Hide quoted text -
- Show quoted text -
You could also put a field somewhere in the repeater that you could
use to fund your items unique ID, to go perform another function on
that item.
to keep it simple, say one of the labels is a record id.
an example is what I use for data grids:
CheckBox myCheckBox = (CheckBox)sender;
GridViewRow dgi;
dgi = (GridViewRow)myCheckBox.Parent.Parent;
string sInvoiceItemID = dgi.Cells[1].Text.Trim();
Trace.Write(sInvoiceItemID);
theMethodTodoRealWork( sInvoiceItemID);
you have identified the item they checked, now perform the operation
on it
a full article that showed me this:
http://aspnet.4guysfromrolla.com/articles/052406-1.aspx
there is also some stuff over at codeproject.com. Do a search for
checkboxes
If you already figured it out, then this is just long term storage for
me and the next time I forget how to do this :).