Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
59 views

We have multiple RadGrids with the MasterTableView configured thusly:

<MasterTableView EditFormSettings-PopUpSettings-KeepInScreenBounds="true" EditMode="PopUp" TimeZoneID="Central Standard Time">

If a record from the database has a null datetime value, the min value of DATETIME data type is used (01/01/0001). When the grid tries convert UTC to CST, we get the error: The added or subtracted value results in an un-representable DateTime.
Parameter name: value.

How can this be handled so the Grid display an empty cell when a null datetime is encountered?

Allan Erickson
Top achievements
Rank 1
 asked on 19 Jan 2023
0 answers
99 views

Trying to add a text box and button into a Column Group Header server side and can't seem to get to the cell of the specific header.  I know how to set the text and all but want to place controls into the header.

protected void RadGrid1_PreRender(object sender, EventArgs e)
{

foreach (GridColumnGroup cg in RadGrid1.MasterTableView.ColumnGroups)
{
if (cg.Name == "HeaderGroupName")
{
cg.HeaderText = "TEST";
}

}

}

Jerry
Top achievements
Rank 2
Iron
Iron
 asked on 18 Jan 2023
0 answers
73 views

Hello
I'm asking you a question because there's a tricky screen.
The screen consists of Grid and Dialog, as shown below.

[StudentGrid]


[StudentDialog]

Hello,

I'm trying to organize the screen, so I'd like your help.

If I press "Add" button to add a new Editable row to Grid[StudentGrid]
And then, go to StudentNo in the added row and press the "Enter" key.
I press "Enter" Key, the [StudentDialog] visible
If I put the student number and press "Enter" key in [StudentDialog], the information of the students corresponding to the grid below will be printed out (for example, if the search term is "10", students with 101, 1001, and 10 will print out as search results)
And [StudentDialog] disappears when selecting one of the rows of the retrieved results.
Insert student's information into [StudentGrid] currentEditRow, which was selected in [StudentDialog].

I am currently using html and javascript.
I'm asking you a question because I couldn't find and try data on where the current Row of grid is 
and how to put the value in each column of grid's current EditRow when selected from dialog.
Please let me know if there is an example or reference for that part.


WoorimartDEV
Top achievements
Rank 1
Iron
Iron
 asked on 18 Jan 2023
0 answers
51 views
RadGrid running in batch edit mode. When selecting a value in dropdown "ddlPayrollId", I need to set  "StaffName" to a certain value, let's say 'Joe' . Can you please provide a VB example on how to do it!

ASPX:
 
<telerik:GridTemplateColumn UniqueName="PayrollId" DataField="PayrollId">
                        <ItemTemplate>
                            <%# Eval("PayrollId")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadDropDownList runat="server" ID="ddlPayrollId" DataValueField="PayrollId" DataTextField="PayrollId" DataSourceID="SqlDataSource1">
                            </telerik:RadDropDownList>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>

<telerik:GridBoundColumn DataField="StaffName" UniqueName="StaffName" ReadOnly="True"></telerik:GridBoundColumn>
Josif
Top achievements
Rank 1
 asked on 08 Dec 2022
0 answers
58 views

I have telerik:RadGrid like this, when I select page 8 then select row and update/delete the Grid reload to page 1. So I want after update/delete the Grid still select page 8 and data update will to appear on Grid.

Before update/delete

After update/delete

Thanks,

Tien
Top achievements
Rank 1
 asked on 30 Nov 2022
0 answers
59 views

Hi,

I am using a RadGrid with a several types of columns, one of them being a GridDropDownColumn.  I am having trouble setting the width of this type of column.  I can get the column width smaller, but the combobox in the column does not get smaller.  What is the correct way to set the width of GridDropDownColumn?  

Thank you,

Mary

 

 

 

Mary
Top achievements
Rank 1
 asked on 21 Nov 2022
0 answers
62 views

Hi Scenario is like when I have made a grouping in my kendo grid and after that if try to search the Id(int) of the grid it throws an error also my grid is server side . getting the error when I am trying to return the list from the controller also it works fine for other columns that are of type string . only the error is coming if we try to search after grouping .

return isGrouping ? Json(lstofToolAction.ToDataSourceResult(request), JsonRequestBehavior.AllowGet) : Json(new { Data = lstofToolAction, Total = total }, JsonRequestBehavior.AllowGet);
          



Error :

Provided expression should have string type\r\nParameter name: stringExpression filter.
Akshay
Top achievements
Rank 1
 asked on 09 Nov 2022
0 answers
82 views

How to attach doc/xlsx/pdf file from host located under virtual directory root to that virtual directory, following by storing its path to MSSQL db

having loading grid and its controls dynamically. experiencing lots of access issues have to use Sys. authentication w/o identity impersonation. cannot retrieve file path of posted file

Edward
Top achievements
Rank 1
 asked on 05 Nov 2022
0 answers
66 views

I have a radgrid that binds an object stored in the ViewState (Case).  When I click on the radgrid's "Add" button (firing the OnInsertCommand) I get the following error: 'Telerik.Web.UI.GridInsertionObject' does not contain a property with the name 'LookupValue'.'  The specific control I am having problems with is the RadDropDownTree, and only when its definition contains this "SelectedValue='<%# Bind("LookupValue.Code") %>'"

I do not understand why this is happening.  What is so different now that my radgrid is binding to a object that contains a subobject??  What do I need to be doing differently?

Just as an fyi, I do not get this error when the OnUpdateCommand fires.  Below is my code.

 

<telerik:RadGrid ID="gvAllegations" runat="server"
                                            AllowAutomaticDeletes="false"
                                            AllowAutomaticInserts="false"
                                            AllowAutomaticUpdates="false"
                                            AllowFilteringByColumn="false"
                                            AllowMultiRowEdit="false"
                                            AllowMultiRowSelection="false"
                                            AllowPaging="false"
                                            AllowSorting="false"
                                            AutoGenerateColumns="false"
                                            OnNeedDataSource="gvAllegations_NeedDataSource"
                                            OnInsertCommand="gvAllegations_InsertCommand"
                                            OnUpdateCommand="gvAllegations_UpdateCommand">
                                            <ClientSettings Selecting-AllowRowSelect="true" />
                                            <GroupingSettings CaseSensitive="false" />
                                            <MasterTableView
                                                CommandItemDisplay="Top"
                                                DataKeyNames="CaseAllegationID"
                                                ClientDataKeyNames="CaseAllegationID">
                                                <Columns>
                                                    <telerik:GridBoundColumn UniqueName="AllegationType" DataField="Type" HeaderText="Type" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                                    <telerik:GridBoundColumn UniqueName="AllegationCodeDescription" DataField="LookupValue.CodeDescription" HeaderText="Allegation" />
                                                </Columns>
                                                <CommandItemTemplate>
                                                    <div class="CommandButtonDiv">
                                                        <asp:LinkButton ID="LinkButton2" runat="server"
                                                            CssClass="CommandButton"
                                                            CommandName="InitInsert"
                                                            Visible='<%# !gvAllegations.MasterTableView.IsItemInserted && gvAllegations.EditIndexes.Count == 0 %>'>
                                                            <img src="Images/AddRecord.png"/> Add
                                                        </asp:LinkButton>
                                                        <asp:LinkButton ID="btnEditSelected" runat="server"
                                                            CssClass="CommandButton"
                                                            CommandName="EditSelected"
                                                            Visible='<%# !gvAllegations.MasterTableView.IsItemInserted && gvAllegations.EditIndexes.Count == 0 %>'>
                                                            <img src="Images/Edit.png" /> Edit
                                                        </asp:LinkButton>
                                                        <asp:LinkButton ID="LinkButton1" runat="server"
                                                            CssClass="CommandButton"
                                                            CommandName="DeleteSelected"
                                                            Visible='<%# !gvAllegations.MasterTableView.IsItemInserted && gvAllegations.EditIndexes.Count == 0 %>'>
                                                            <img src="Images/Delete.png"/> Delete
                                                        </asp:LinkButton>
                                                        <asp:LinkButton ID="LinkButton4" runat="server"
                                                            CssClass="CommandButton"
                                                            CommandName="RebindGrid"
                                                            Visible='<%# !gvAllegations.MasterTableView.IsItemInserted && gvAllegations.EditIndexes.Count == 0 %>'>
                                                            <img src="Images/Refresh.png"/> Refresh
                                                        </asp:LinkButton>
                                                        <asp:LinkButton ID="LinkButton3" runat="server"
                                                            CssClass="CommandButton"
                                                            CommandName="PerformInsert" Visible='<%# gvAllegations.MasterTableView.IsItemInserted %>'>
                                                            <img src="Images/Insert.gif"/> Save
                                                        </asp:LinkButton>
                                                        <asp:LinkButton ID="LinkButton5" runat="server"
                                                            CssClass="CommandButton"
                                                            CommandName="UpdateEdited" Visible='<%# gvAllegations.EditIndexes.Count > 0 %>'>
                                                            <img src="Images/Update.png"/> Update
                                                        </asp:LinkButton>
                                                        <asp:LinkButton ID="btnCancel" runat="server"
                                                            CssClass="CommandButton"
                                                            CommandName="CancelAll" Visible='<%# gvAllegations.MasterTableView.IsItemInserted || gvAllegations.EditIndexes.Count > 0 %>'>
                                                            <img src="Images/Cancel.png"/> Cancel
                                                        </asp:LinkButton>
                                                    </div>
                                                </CommandItemTemplate>
                                                <EditFormSettings EditFormType="Template">
                                                    <FormTemplate>
                                                        <table style="width: 100%">
                                                            <tr>
                                                                <td>Allegation</td>
                                                                <td>
                                                                    <telerik:RadDropDownTree ID="ddtAllegation" runat="server"
                                                                        AutoPostBack="False"
                                                                        DataFieldId="Code"
                                                                        DataFieldParentID="ParentCode" 
                                                                        DataValueField="Code"
                                                                        DataSourceID="odsAllegationLookupValues"
                                                                        DataTextField="CodeDescription"
                                                                        EnableFiltering="True"
                                                                        ExpandNodeOnSingleClick="True"
                                                                        SelectedValue='<%# Bind("LookupValue.Code") %>'
                                                                        Width="300px">
                                                                        <DropDownSettings AutoWidth="Enabled" CloseDropDownOnSelection="true" />
                                                                        <FilterSettings EmptyMessage="Search Allegation" Filter="Contains" Highlight="Matches" />
                                                                    </telerik:RadDropDownTree>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>Major Allegation</td>
                                                                <td><telerik:RadCheckBox ID="chbMajorAllegation" runat="server" 
                                                                    AutoPostBack="False" Checked='<%# Bind("IsMajor") %>' /></td>
                                                            </tr>
                                                            <tr>
                                                                <td colspan="2" style="text-align: center">
                                                                    <telerik:RadButton ID="btnInsert" runat="server"
                                                                        CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'
                                                                        Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                                                        Width="100px" />
                                                                    <telerik:RadButton ID="btnCancel" runat="server"
                                                                        Text="Cancel"
                                                                        CommandName="Cancel"
                                                                        Width="100px" />
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </FormTemplate>
                                                </EditFormSettings>
                                            </MasterTableView>
                                        </telerik:RadGrid>

 


    [Serializable]
    public class Case
    {
        public int ID { get; set; }
        public List<Allegation> Allegations { get; set; }
    }
    [Serializable]
    public class Allegation
    {
        public int CaseAllegationID { get; set; }
        public bool IsMajor { get; set; }
        public string Type
        {
            get
            {
                if (IsMajor)
                    return "Major";
                else
                    return "Other";
            }
        }
        public LookupValue LookupValue { get; set; }
    }
    [Serializable]
    public class LookupValue
    {
        public string Code { get; set; }
        public string Description { get; set; }
        public string CodeDescription { get { return Code + " - " + Description; } }
        public string ParentCode { get; set; }
        public int DimID { get; set; }
        public DateTime DimStartDate { get; set; }
        public DateTime DimEndDate { get; set; }
        public bool DimIsActive { get; set; }
    }    


        protected void gvAllegations_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            gvAllegations.DataSource = ((Case)ViewState["rcaCase"]).Allegations;
        }
        protected void gvAllegations_InsertCommand(object sender, GridCommandEventArgs e)
        {

        }

Jonathan
Top achievements
Rank 1
Iron
 updated question on 01 Nov 2022
0 answers
91 views

Hello!

I was wondering, is it possible to change the icons of the export button in the footer of the radgrid? (Xls, pdf and csv).

I tried modifying their CSS classes, but did not work.

Thanks!

Johnny
Top achievements
Rank 3
Bronze
Iron
Iron
 updated question on 24 Oct 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?