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
105
Re Hide columns using javascript on UltraWebGrid
posted
Hi,Can you tell me if the following is possible.I have designed a Ultra Web Grid using the following code (see below). My question is, Depending on the value of DropDownList, I want the user to enter data in either column ValueDropDown, ValueDate or ValueDate.Is it possible to hide the columns I don't need using Javascript after selection of DropDownList, or is there another way to achieve this without having to hide columns.  Thanks for your helpKevin   <igtbl:UltraWebGrid ID="uwgAttributes" runat="server" Width="100%"><Bands><igtbl:UltraGridBand><Columns><igtbl:UltraGridColumn Hidden="True" Key="AttributeID"><Header Caption="AttributeID"></Header></igtbl:UltraGridColumn><igtbl:UltraGridColumn DataType="System.DateTime" EditorControlID="wdSkillsEditor"Format="dd/MM/yyyy" Key="From" Type="Custom" Width="20%"><Header Caption="Gultig Vom"><RowLayoutColumnInfo OriginX="1" /></Header><Footer><RowLayoutColumnInfo OriginX="1" /></Footer></igtbl:UltraGridColumn><igtbl:UltraGridColumn DataType="System.DateTime" EditorControlID="wdSkillsEditor"Format="dd/MM/yyyy" Key="To" Type="Custom" Width="20%"><Header Caption="Gultig Bis"><RowLayoutColumnInfo OriginX="2" /></Header><Footer><RowLayoutColumnInfo OriginX="2" /></Footer></igtbl:UltraGridColumn><igtbl:UltraGridColumn DataType="System.Int32" Key="Name" Type="DropDownList" Width="20%"><Header Caption="Attribute"><RowLayoutColumnInfo OriginX="3" /></Header><Footer><RowLayoutColumnInfo OriginX="3" /></Footer></igtbl:UltraGridColumn><igtbl:UltraGridColumn DataType="System.DateTime" EditorControlID="wdSkillsEditor"Format="dd/MM/yyyy" Key="ValueDate" Type="Custom" Width="20%" Hidden="false"><Header Caption="ValueDate"><RowLayoutColumnInfo OriginX="2" /></Header><Footer><RowLayoutColumnInfo OriginX="2" /></Footer></igtbl:UltraGridColumn><igtbl:UltraGridColumn DataType="System.Int32" Key="ValueDropDown" Type="DropDownList" Width="20%" Hidden="false"><Header Caption="ValueDropDown"><RowLayoutColumnInfo OriginX="3" /></Header><Footer><RowLayoutColumnInfo OriginX="3" /></Footer></igtbl:UltraGridColumn><igtbl:UltraGridColumn Hidden="false"><Header Caption="ValueInt"><RowLayoutColumnInfo OriginX="2" /></Header><Footer><RowLayoutColumnInfo OriginX="2" /></Footer></igtbl:UltraGridColumn></Columns><AddNewRow View="NotSet" Visible="NotSet"></AddNewRow></igtbl:UltraGridBand></Bands><DisplayLayout AllowDeleteDefault="Yes" AllowUpdateDefault="Yes" BorderCollapseDefault="Separate"Name="uwgAttributes" RowHeightDefault="16px" RowSelectorsDefault="No" SelectTypeRowDefault="Single"StationaryMargins="Header" StationaryMarginsOutlookGroupBy="True" TableLayout="Fixed"Version="4.00" AllowAddNewDefault="Yes" AutoGenerateColumns="False" CellClickActionDefault="Edit"><FrameStyle Width="100%" BorderColor="#A1B1C8" BorderStyle="Solid" BorderWidth="1px"></FrameStyle><ClientSideEvents BeforeExitEditModeHandler="uwgAttributes_BeforeExitEditModeHandler" KeyDownHandler="MappingGridKeyDownHandler" BeforeEnterEditModeHandler="uwgAttributes_BeforeEnterEditModeHandler" AfterExitEditModeHandler="uwgAttributes_AfterExitEditModeHandler" /><EditCellStyleDefault BorderStyle="None" BorderWidth="0px"></EditCellStyleDefault><HeaderStyleDefault Wrap="True" ForeColor="White" BackColor="#89A3C8" BorderColor="#5E7BA5" BorderStyle="Solid" BorderWidth="1px" Font-Size="11px"><Padding Top="2px" Right="2px" Bottom="2px" Left="2px" /><BorderDetails ColorLeft="137, 163, 200" ColorTop="137, 163, 200" /></HeaderStyleDefault><RowStyleDefault BorderColor="#A1B1C8" BorderStyle="Solid" BorderWidth="1px" BackColor="White"><Padding Top="2px" Bottom="2px" Left="3px" /><BorderDetails ColorLeft="White" ColorTop="White" /></RowStyleDefault><GroupByRowStyleDefault BackColor="Control" BorderColor="Window"></GroupByRowStyleDefault><GroupByBox><BoxStyle BackColor="ActiveBorder" BorderColor="Window"></BoxStyle></GroupByBox><ActivationObject BorderColor="" BorderWidth=""></ActivationObject></DisplayLayout></igtbl:UltraWebGrid> 

 

  • 28464
    posted

    Hello,

    Thanks for writing. This could be possible using the CSOM (Client Side Object Model) of our UltraWebGrid product. Please, take a look at our online help for CSOM, and especially the Columns client-side object

    http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR3.5/html/WebGrid_Column_Object_CSOM.html

    you can play with the setHidden method - this seems close to what you need.

    You can also search the forum for threads employing setHidden for sample code:

    http://forums.infragistics.com/search/SearchResults.aspx?q=setHidden

    Please, let me know if this helps. 

  • 8680
    posted

    Suggestion: Improve legibility by using line breaks and indentation.

    I'm no JavaScript guru, but you can find a lot of information on working with grids on the client side in the online docs.

    HTH