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
1230
Webdatagrid Tab issue
posted

In Webdatagrid, how can one avoid border around row, when Tab is pressed?

To enable Tab to work in grid, I had set  the Activation behavior to enabled, and in Cell Editing and Row Adding, for EditModeActions I needed to EnableOnActive to "True" (I also set EnableF2 to false)

Below is the link to create a border around cell & Row:

http://www.infragistics.com/community/forums/t/108251.aspx

  • 1230
    posted

    Done it like below to implement Tab key functionality to move from one cell to another. Moreover, to create a border around selected cell(on cell click/Tab key press) and selected row(on RowSelector click).

    <style type="text/css">

     tbody>tr>td.igg_SelectedCell, tbody>tr:hover>td.igg_SelectedCell {

       background-color:white;
       border-bottom: 0px solid #000;
       border-top: 0px solid #000;           
    }
    tbody>tr>td.igg_SelectedCell[aria-selected=true] {
     border: 1px solid #000 !important;
    }

    tbody.igg_ItemWhiteBorder1>tr>td{

     font-size:8pt; font-family:Verdana; background-color:white; text-align:left; vertical-align:middle; text-overflow: ellipsis !important; border-right:1px solid #fff; border bottom: 1px solid #fff;

    }

    <style>

    <script type="text/javascript">

    $(document).ready(function(){
        $('#<%=hfIsRowSelectorClicked.ClientID%>').attr('value','0');
        });

    function rowSelectorClicked(){

      $('#<%=hfIsRowSelectorClicked.ClientID%>').attr('value','1');

    }

    function uwgRD_EnteringEditMode(grid,eventArgs)

    {

      if(document.getElementById("<%=hfIsRowSelectorClicked.ClientID%>").value == '1')

    {

         if($('table tr td').hasClass('igg_SelectedCell')){

             $('table tr td.igg_SelectedCell').css("border-bottom","1px solid black");

             $('table tr td.igg_SelectedCell').css("border-top","1px solid black");

             $('table tr td.frstChild').css("border-left-color","#fff");

             $('table tr td.lstChild').css("border-right-color","#fff");

        }

      if(document.getElementById("<%=hfIsEditMode.ClientID%>").value == '1')

           eventArgs.set_cancel(false);

    else

          eventArgs.set_cancel(false);

    }

    }

    </script>

    Defined grid like:

     <asp:HiddenField ID="hfIsRowSelectorClicked" runat ="server" Value ="-1" /> <asp:HiddenField ID="hfIsEditMode" runat ="server" Value ="-1" />

    <ig:WebDataGrid ID="uwgRD" runat="server" AutoGenerateColumns="False" Width="750px" AltItemCssClass="AltRows" 
    HeaderCaptionCSSClass="igg_HeaderCaptionWhiteBorder" ItemCSSClass="igg_ItemWhiteBorder1"
    DatakayFields="Id>
    <
    Columns>
    <
    ig:UnboundField DataFieldName="UserName" Key="UserName" CSSClass="frstChild"></ig:UnboundField>
     <ig:UnboundField DataFieldName="EName" Key="EName"></ig:UnboundField>

    ......
     <ig:TemplateField Key="Delete" CSSClass="lstChild">
    <ItemTemplate>
    <asp:Button ID="btnDelete" onClick="btnDelete_Click" Enabled='<%#(hfIsEditMode.Value == "1")?true : false %>' Text="Delete" />
    </ItemTemplate>
    </ig:TemplateField>
    </Columns>
    <EditorProviders>
    <ig:DropDownProvider ID="ICP">
    <EditorControl ID="editIC" runat="server" DisplayMode="DropDownList" TextField="ShortName" ValueField="Id"></EditorControl>
    </ig:DropDownProvider>
    </EditorProviders>
     <Behaviors>
    <ig:EditingCore>
     <Behaviors>
    <ig:CellEditing Enabled="true">
    <ColumnSettings>
    <ig:EditingColumnSetting ColumnKey="UserName" EditorID="ICP"/>
    <ColumnSettings>
    <EditModeActions MouseClick ="Single" EnableOnActive="True" EnableOnKeyPress="True" />
    <CellEditingClientEvents EnteringEditMode ="uwgRD_EnteringEditMode" />
    </ig:CellEditing>
     </Behaviors>
    </ig:EditingCore>
    <ig:RowSelectors Enabled="true" RowSelectorClicked="rowSelectorClicked" />
     <ig:Selection CellClickAction="Cell" Enabled="true" RowSelectType="Single">
     <ig:Activation ActiveRowCSSClass="activeRowCSS" Enabled = "true" /> </ig:Activation>
     
    </Behaviors>
     
    </ig:WebDataGrid>
  • 2680
    Offline posted in reply to Birendra Aujla

    Hello,

    Thank you for contacting us.

    For styling please use our guide - http://www.infragistics.com/community/blogs/engineering/archive/2010/08/25/webdatagrid-css-styling-guide.aspx.

    If you need further assistance, please provide a working solution demonstrating the issue. You can zip it and attach it to your next post.

    I am looking forward to hearing from you.