Hi,
I am using WebDatagrid (Infragistics4.Web.v.11.1) . In my grid I have 3 Date columns I am utilizing
columnMoving feature. All three Date Coulmns are in TemplateDataField and other are
bounddatafield. For bounddatafield columnMoving feature work correct.But I try to move Date column
I got following error.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Invalid JSON primitive: |0|01||.
Dose anyone have any Idea about above error.
Thanks,
Vaibhav
Hi vaibhavdeshmukh,
I am still researching the matter, however I can suggest a possible approach for this scenario. You could add the WebDatePicker to the header template’s controls collection and re-bind the grid from the code-behind on every page load. Please find attached the demonstrative sample
Let me know if this helps.
Hi Nikolay,
Thanks for your reply.
I had look at the example link you provided. But in my case I am using TamplateDataField for showing
Datecolumn also I am providing "wedDatapicker" in header of that column for filtering records that
column between those start and end date of "webDatapicker". So when I try to move this to another
column I am getting above error.
Here I am providing you sample code that grid.
<ig:WebDataGrid ID="wdgABC" runat="server" DataSourceID="OdsABC" DataKeyFields="ABCID" EnableAjax="False" ItemCssClass="GridItemClass" Width="1075px" AltItemCssClass="GridAltItemClass" AutoGenerateColumns="False" OnItemCommand="wdgABC_ItemCommand" EnableViewState="true" OnDataFiltering="wdgABC_DataFiltering" EnableDataViewState="True" OnDataBound="wdgABC_DataBound" OnInitializeRow="wdgABC_InitializeRow" OnPreRender="wdgABC_PreRender" BorderStyle="Solid"> <Columns> <ig:TemplateDataField Width="50px" Key="itemSelector" Header-CssClass="GridHeaderCaptionClass"> <HeaderTemplate> <div id="div1" class="CheckBoxTemplateColumn"> <asp:CheckBox ID="checkboxHeader" onclick="selectAll(this)" runat="server" /> </div> <asp:ImageButton ID="btnClearFilter" runat="server" Width="15px" OnClientClick="clearOtherFilters()" OnClick="btnClearFilter_Click" ImageUrl="~/App_Themes/EYTheme/Images/FilterOff.png" /> </HeaderTemplate> <ItemTemplate> <div class="CheckBoxTemplateColumn"> <asp:CheckBox ID="selectItem" runat="server" EnableViewState="true" class="CheckBoxTemplateColumn" onclick="AddToList(this);" /></div> </ItemTemplate> <Header Text=""></Header> </ig:TemplateDataField> <ig:TemplateDataField Key="ABCSourceID" Width="100px" Header-CssClass="GridHeaderCaptionClass"> <ItemTemplate> <asp:LinkButton ID="linkABCID" CommandName="hyperClicked" CommandArgument='<%#DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "ABCID") %>' runat="server"><%# DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "ABCSourceId")%></asp:LinkButton> </ItemTemplate> <Header Text="ABC ID"></Header> </ig:TemplateDataField> <ig:BoundDataField Header-Text="ABC Description" DataFieldName="Description" Header-CssClass="GridHeaderCaptionClass" Key="Description" Width="110px"> <Header Text="ABC Description"></Header> </ig:BoundDataField> <ig:BoundDataField Header-Text="ABC Location City" DataFieldName="CityOrLocale" Header-CssClass="GridHeaderCaptionClass" Key="CityOrLocale" Width="100px"> <Header Text="ABC Location City"></Header> </ig:BoundDataField> <ig:TemplateDataField Key="ABCAcquisitionDate" Header-CssClass="DatePickerOnHeader" CssClass="ColumnDateNumberCss"> <ItemTemplate> <div> <%# EY.PTAS.UI.UIObjects.PageUtility.DateTimeHelper(DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "ABCAcquisitionDate"))%> </div> </ItemTemplate> <HeaderTemplate> <table class="ColumnDatePickerHeaderCss"> <tr> <td> <ig:WebDatePicker ID="StartWebDatePicker" runat="server" Width="75px" DisplayModeFormat="MM-dd-yyyy" EditModeFormat="MM-dd-yyyy" DropDownCalendarID="WebMonthCalendarHelperOnGid"> <Buttons> <CustomButton ImageUrl="~/ig_res/Default/images/igdd_DropDownButtonDisabled.png" /> </Buttons> </ig:WebDatePicker> <ig:WebMonthCalendar ID="WebMonthCalendarHelperOnGid" runat="server" CssClass="DatePickerHeaderHeader"> </ig:WebMonthCalendar> </td> <td> <ig:WebDatePicker ID="EndWebDatePicker" runat="server" Width="75px" DisplayModeFormat="MM-dd-yyyy" DropDownCalendarID="WebMonthCalendarHelperOnGid" EditModeFormat="MM-dd-yyyy"> <Buttons> <CustomButton ImageUrl="~/ig_res/Default/images/igdd_DropDownButtonDisabled.png" /> </Buttons> </ig:WebDatePicker> </td> <td> <asp:ImageButton ID="imgBtnABCAcqDate" runat="server" ImageUrl="~/ig_res/Default/images/igg_Filter.gif" OnClick="imgBtnABCAcqDate_Click" /> </td> </tr> </table> ABC Acquisition Date </HeaderTemplate> <Header Text="ABC Acquisition Date" /> </ig:TemplateDataField> <ig:TemplateDataField Key="PartnershipInServiceDate" Header-CssClass="DatePickerOnHeader" CssClass="ColumnDateNumberCss"> <ItemTemplate> <div> <%# EY.PTAS.UI.UIObjects.PageUtility.DateTimeHelper(DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "PartnershipInServiceDate"))%> </div> </ItemTemplate> <HeaderTemplate> <table class="ColumnDatePickerHeaderCss"> <tr> <td> <ig:WebDatePicker ID="StartWebDatePicker1" runat="server" Width="75px" DisplayModeFormat="MM-dd-yyyy" DropDownCalendarID="WebMonthCalendarHelperOnGid" EditModeFormat="MM-dd-yyyy"> <Buttons> <CustomButton ImageUrl="~/ig_res/Default/images/igdd_DropDownButtonDisabled.png" /> </Buttons> </ig:WebDatePicker> </td> <td> <ig:WebDatePicker ID="EndWebDatePicker1" runat="server" Width="75px" DisplayModeFormat="MM-dd-yyyy" DropDownCalendarID="WebMonthCalendarHelperOnGid" EditModeFormat="MM-dd-yyyy"> <Buttons> <CustomButton ImageUrl="~/ig_res/Default/images/igdd_DropDownButtonDisabled.png" /> </Buttons> </ig:WebDatePicker> </td> <td> <asp:ImageButton ID="imgbtnPatnershipInServiceDate" runat="server" ImageUrl="~/ig_res/Default/images/igg_Filter.gif" OnClick="imgbtnPatnershipInServiceDate_Click" /> </td> </tr> </table> Partnership In Service Date </HeaderTemplate> <Header Text="Partnership In Service Date" /> </ig:TemplateDataField> </Columns> <Behaviors> <ig:Paging PagerAppearance="Top" Enabled="true" PagerMode="NextPreviousFirstLast"> <PagerTemplate> <uc1:EYPager ID="pagerABC" runat="server" EnableViewState="true" /> </PagerTemplate> </ig:Paging> <ig:Filtering> <FilteringClientEvents FilterDropdownDisplaying="wdgFilteringDropdown" /> </ig:Filtering> <ig:Selection RowSelectType="Multiple" CellSelectType="None" SelectedCellCssClass="SelectedCellClass"> <SelectionClientEvents /> <AutoPostBackFlags RowSelectionChanged="True" /> <AutoPostBackFlags RowSelectionChanged="True"></AutoPostBackFlags> </ig:Selection> <ig:ColumnResizing> </ig:ColumnResizing> <ig:ColumnMoving DragMarkupCssClass=""> </ig:ColumnMoving> <ig:Sorting> <ColumnSettings> <ig:SortingColumnSetting ColumnKey="itemSelector" Sortable="false" /> </ColumnSettings> </ig:Sorting> </Behaviors> </ig:WebDataGrid>
If you find any solution on this ,please let me know.
Vaibhav.
Please let me know if you need further assistance on this matter.
Thank you for posting in the community.
I have tested the described scenario with both versions 11.1.20111.1006 and 11.1.20111.2064 but I wasn’t able to reproduce this behavior. These are the steps I took creating the sample: I bound the WebDataGrid to ‘Categories’ table from Northwind database and added 3 TemplateDataFields. I run the project under Firefox, Chrome, IE 7, 8 and 9 and tried the column moving functionality. It was working correctly. Please check the attached sample.
Please note that you may use BoundDataFields for displaying dates in your grid. Should you need to edit the date fields you may use DatePickerProvider in these columns. You can find samples of using providers with the WebDataGrid at: http://samples.infragistics.com/aspnet/Samples/WebDataGrid/Editing-and-Selection/Editing-Editor-Providers/Default.aspx?cn=data-grid&sid=12b48e9e-8ffb-4c61-837c-58118040f669
In order to investigate this issue further I would need more details or a sample of your code.
If you need any further assistance on the matter please do not hesitate to ask.