Web Grid data display in List Box

4 replies. Last post: January 28, 2010 5:56 AM by Allan Donald
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Allan DonaldMember

Hi

I have a web grid which contains 4 fields as Name, 1, 2, 3, 4 in which name field displas names and other field diplays a single character(let it be A for one field D for other etc) as table given below.i am loading webgrid fields and values at runtime.  on window load i am giving input check box as inner html for the fields 1,2,3,4 if character exists. Now my doubt is, when i click on the check box i have to disply the clicked character in the list box. For example if click on character A and D against name 'astr', the list box have to show it as astr A D. like that show for all check boxes i click. I want to do all these operations in client side.. 



Name 1 2 3 4
astr A D C T
bstr C T
cstr T


Codes

Window onload function

window.onload = function() {

            var i; var j;

            var grid = ISGetObject("WGActivity");

            var tblElm = grid.RootTable.GetElement(WG40.BODY, WG40.HTMLTABLE);

            var no = tblElm.rows.length;


            for (i = 0; i < tblElm.rows.length; i++) {


                for (j = 1; j < tblElm.rows[i].cells.length; j++) {

                    var val = tblElm.rows[i].cells[j].innerText;

                    if (tblElm.rows[i].cells[j].innerText != " ") {

                        tblElm.rows[i].cells[j].innerHTML = "<INPUT id='h' TYPE=CHECKBOX  onClick='display();'>" + val;

                    }

                }

            }

            return true;


        }

Webgrid and listbox

<table width="100%">

        

        <tr>

        

            <td style="height: 100%; width: 100%">

            

                            <ISWebGrid:WebGrid ID="WGActivity" runat="server" Height="220px" Width="400px"

                                UseDefaultStyle="True" DefaultStyleMode="Elegant">

                                <RootTable >

                                    <Columns>

                                     

                                    </Columns>

                                </RootTable>

                                <LayoutSettings GridLines="None" AllowDefaultStyleMerging="true"  ApplyFiltersKey="Enter" AlwaysShowHelpButton="False" AutoFitColumns="true"  AllowSorting="Yes"

                                    AllowColumnSizing="No" RowHeaders="No" AllowFilter="Yes" AllowGrouping="Yes" ShowRefreshButton="false"  

                                    AllowExport="no" FilterBarVisible="false" AutoFilterSuggestion="True" HideColumnsWhenGrouped="No" >

                                    <HeaderStyle Font-Names="sans-serif" Font-Size="8" CustomRules="padding-left:3px;padding-right:3px;">

                                    </HeaderStyle>

                                    <RowStyle Cursor="Hand" Font-Names="sans-serif"  Font-Size="8" CustomRules="padding-left:3px;padding-right:3px;"/>

                                    <AlternatingRowStyle Cursor="Hand"   Font-Names="sans-serif" Font-Size="8" CustomRules="padding-left:3px;padding-right:3px;"/>

                                  <ClientSideEvents OnInitialize="WG_Init" />

                                     <TextSettings Language="UseCulture" UseWebResources="False">

                                    </TextSettings>                                    

                                </LayoutSettings>

                            </ISWebGrid:WebGrid>

            </td>

            

        </tr>

           <tr>

            <td>

                <asp:ListBox ID="lbactivity" runat="server" Height="180px" SelectionMode="Multiple" Width="250px">

                            </asp:ListBox>

            </td>

        </tr>

</table>



All times are GMT -5. The time now is 3:26 AM.
Previous Next