C1 Community
ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Call from C1WebGrid

rated by 0 users
This post has 1 Reply | 0 Followers

Not Ranked
Posts 9
simaarco Posted: Mon, Mar 16 2009 2:04 AM

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.

 

Top 10 Contributor
Posts 1,103
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) | RSS
Contact ComponentOne: 1.800.858.2739 ©1987-2010 ComponentOne LLC All Rights Reserved.