Hello there,
I'm trying to bind a Label, which is shown in edit mode, to a Linkbutton, but just with the text of the Linkbutton.
My approach is something like this:
<ClientBindings> <ig:RowEditingClientBinding ColumnKey="Name" ControlID="lblNameEdit" GetValueJavaScript="$get({ClientID}).Text" SetValueJavaScript="$get({ClientID}).Text={value}" />
Well, nothing happens, the Label is still empty. As fas as I've seen in javascript you call the function to get the cell-value, which is not only the text (or title, however), but the whole syntax as well.
Am I using the Binding wrong? Is this even possible? If not, is there a solution to do this?
Thanks for your response
Müller Matthias
I guess, I found the issue while I was debugging your javascript code:As Value, you just get the Cell-value, which is ofc a lot of code, when you're working with a template.
In the _copyValuesToTemplate function you replace {value} with cell.get_value(), which might work fine if there just is one databound item, but if I have for example my multiline textbox, it returns something like this:
<a style="width: 200px; text-decoration: underline; display: inline-block; white-space: pre-wrap;" id="ctl00_cphMainContent_panRoles_contentTemplate_dgrRoles_it1_0_linkBtnName" title="MY TEXT" href="BLOCKED SCRIPT__doPostBack('ctl00$cphMainContent$panRoles$contentTemplate$dgrRoles$it1_0$linkBtnName','')">MY TEXT</a> "
Is it possible to overwrite the cell_getvalue anyhow and point this to the value I want?
Thanks for your response so far.
Matthias
Found it, needed to learn a bit of javascript/jquery to do the trick. For 2 textboxes in the same cell I just used this
<ig:RowEditingClientBinding ColumnKey="BeginEndDate" ControlID="txtBeginDate" GetValueJavaScript="cell.get_element().children(0).innerText = $find({ClientID}).get_value(); cell.get_element().children(2).innerText=$get({ClientID}).parentNode.children(3).innerText" SetValueJavaScript="$find({ClientID}).set_value(cell.get_element().children(0).innerText); $get({ClientID}).parentNode.children(3).innerText=(cell.get_element().children(2).innerText);" />
The problem is at writing back, it checks cell_value, which causes errors when ValidateRequest is turned on.