Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
165
ClientBinding, setting Text from a Linkbutton to a Label
posted

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

Parents
  • 165
    posted

    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

Reply Children
No Data