Re: Call from C1WebGrid

Legacy

A description has not yet been added to this group.

Call from C1WebGrid

  • rated by 0 users
  • This post has 1 Reply |
  • 0 Followers
  • Good day.

    Very easy question: how can I call c1Dialog from a C1WebGrid hyperlink column ? In other words, I would like to call C1Dialog from the event ItemCommand of a C1WebGrid. The grid can be inside UpdatePanel or not ...

    Thank you very much. Paolo.

     

  • Hi,
     
    "C1WebGrid hyperlink column" (if you say about C1HyperLinkColumn class) can't invoke the ItemCommand event.
    ItemCommand can be triggered by C1ButtonColumn and C1EditCommandColumn.
     
    Anyway, in case of C1HyperLink all the interaction with C1WebDialog will be pure client:
     
    <C1WebDialog:C1WebDialog ... ID="C1WebDialog1" ....>
    ...
    </C1WebDialog:C1WebDialog>
     
    ...
     
    <C1WebGrid:C1WebGrid ... ID="C1WebGrid1">
      <Columns>
       ....
       <C1WebGrid:C1HyperLinkColumn Text="call" NavigateUrl="BLOCKED SCRIPT$find('C1WebDialog1').show()" />
       ....
      </Columns>
    </C1WebGrid:C1WebGrid>
     

    in case of server-side (ItemCommand event) implementation will be a bit more complicated since
    grid can be in UpdatePanel:
     
    aspx:
    ====
     
    <script type="text/javascript">
      function pageLoad()
      {
        var status = $get("dialogStatus");
        if (status.value == "1")
        {
          status.value = "0";
          $find("C1WebDialog1").show();
        }
      }
    </script>
     

    <input type="hidden" id="dialogStatus" />
     
    <C1WebDialog:C1WebDialog ... ID="C1WebDialog1" ....>
    ...
    </C1WebDialog:C1WebDialog>
     
    ...
     
    <C1WebGrid:C1WebGrid ... ID="C1WebGrid1" ... OnItemCommand="C1WebGrid1_ItemCommand">
    ...
     <Columns>
       ....
       <C1WebGrid:C1ButtonColumn CommandName="call" Text="call" />
       ....
     </Columns>
    ...
    </C1WebGrid:C1WebGrid>
     
    cs:
    ===
    protected void C1WebGrid1_ItemCommand(object sender, C1CommandEventArgs e)
    {
      if (e.CommandName == "call")
      {
        ScriptManager.RegisterStartupScript(this, typeof(C1WebGrid),
          "C1WebGrid_callDialog", "$get('dialogStatus').value = '1';", true);
      }
    }
     
    Regards,
    Sergey.
    <simaarco> wrote: news:215407@10.0.1.98...

    Good day.

    Very easy question: how can I call c1Dialog from a C1WebGrid hyperlink column ? In other words, I would like to call C1Dialog from the event ItemCommand of a C1WebGrid. The grid can be inside UpdatePanel or not ...

    Thank you very much. Paolo.

     



    http://helpcentral.componentone.com/cs/forums/p/78526/215407.aspx#215407

Page 1 of 1 (2 items)