Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
348 views
  Im data binding a radgrid to a datatable and creating the columns and setting them to a column in the datatable. This shows all the columns and creates the correct number of rows but doesn't bind the values from the datatable into the grid. My code is below. and see screenshot attached.


          Me.uxGrid.DataSource = dt

            For Each dc In dt.Columns

                gc = New GridBoundColumn
                gc.HeaderText = dc.Caption
                gc.UniqueName = dc.Caption
                gc.DataField = dc.Caption
                Me.uxGrid.MasterTableView.Columns.Add(gc)

            Next

            Me.uxGrid.DataBind()
Princy
Top achievements
Rank 2
 answered on 17 Sep 2010
5 answers
159 views
I'm trying to do a simple grouping in my grid but I cannot figure out what I am missing.  All I want in my group "header" i guess it would be called is the field name but for some reason it is coming out [field_title]: [field_name].  When can I remove the field_title and only show field_name?

 

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"

 

 

DataSourceID="sqlCategories" GridLines="None">

 

<

 

MasterTableView DataKeyNames="Main_Category_ID,Sub_Category_ID"

 

 

DataSourceID="sqlCategories">

 

<

 

RowIndicatorColumn>

 

<

 

HeaderStyle Width="20px"></HeaderStyle>

 

</

 

RowIndicatorColumn>

 

<

 

ExpandCollapseColumn>

 

<

 

HeaderStyle Width="20px"></HeaderStyle>

 

</

 

ExpandCollapseColumn>

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="Main_Category"

 

 

SortExpression="Main_Category" UniqueName="Main_Category" Visible="False">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Sub_Category" HeaderText="Sub_Category"

 

 

SortExpression="Sub_Category" UniqueName="Sub_Category">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Sub_Category_Desc"

 

 

HeaderText="Sub_Category_Desc" SortExpression="Sub_Category_Desc"

 

 

UniqueName="Sub_Category_Desc">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Main_Category_ID" DataType="System.Int32"

 

 

HeaderText="Main_Category_ID" ReadOnly="True" SortExpression="Main_Category_ID"

 

 

UniqueName="Main_Category_ID">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Sub_Category_ID" DataType="System.Int32"

 

 

HeaderText="Sub_Category_ID" ReadOnly="True" SortExpression="Sub_Category_ID"

 

 

UniqueName="Sub_Category_ID">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

<GroupByExpressions>

 

 

<telerik:GridGroupByExpression>

 

 

<SelectFields>

 

 

<telerik:GridGroupByField FieldAlias="Main_Category" FieldName="Main_Category" FormatString="{0}"></telerik:GridGroupByField>

 

 

</SelectFields>

 

 

<GroupByFields>

 

 

<telerik:GridGroupByField FieldName="Main_Category" SortOrder="Descending"></telerik:GridGroupByField>

 

 

</GroupByFields>

 

 

</telerik:GridGroupByExpression>

 

 

</GroupByExpressions>

 

</

 

MasterTableView>

 

 

</telerik:RadGrid>

 

Espen Fosshaug
Top achievements
Rank 1
 answered on 17 Sep 2010
2 answers
73 views
Good day!
I use two RadMenu at the same time. One of them is depended on enother. But I want the first one to have z-index bigger than second one =(
but they behave wrong =(
You can see the bug at attached image.
Both grids have the same my own custom skin,
Z-index of div with the first menu is bigger than z-index of the div with second one.
what can I do? =(
lina fetisova
Top achievements
Rank 1
 answered on 17 Sep 2010
6 answers
144 views
Hi,

Is it possible to have predefined timeslots? For example that all mondays should be divided into bookable timeslots, 8:00 to 11:00, 11:00 to 14:00, 14:00 to 17:00 and so on. All tuesday´s could have a completly different setup and so on.

Possible with templates or something?

//Johnny
Johnny
Top achievements
Rank 1
 answered on 17 Sep 2010
1 answer
120 views
Hi,

I have radgrid with show and hide filter options. Initially filter is disabled. When i click show filter button it is displaying the filter but pageritem in the bottom is not displaying if i click hide button the pageritem is displaying. (Please see the Iamges) I set " PagerStyle-AlwaysVisible="true" ". But still no luck. Can anyone help me how to fix this? ( I am reposting this thread because I am unable to upload pics to my previous post)

Here is my code

<div style="width: 98%; overflow: auto; overflow-y: hidden">
        <telerik:RadGrid ID="gvPjtMnt" runat="server" Height="600px" AutoGenerateColumns="false"
            BorderWidth="2px" BorderStyle="Solid" BackColor="White" AllowPaging="True" PagerStyle-AlwaysVisible="true"
            PageSize="20" AllowSorting="True" AllowFilteringByColumn="true" OnNeedDataSource="gvPjtMnt_OnNeedDataSource"
            OnItemCommand="gvPjtMnt_ItemCommand" OnItemCreated="gvPjtMnt_ItemCreated" EnableViewState="true">
            <HeaderStyle Height="20px" BackColor="#004000" Font-Size="8pt" Font-Bold="True" ForeColor="White"
                HorizontalAlign="Center" BorderColor="White" BorderWidth="1px" />
            <AlternatingItemStyle Font-Size="8pt" BackColor="#F5F5E9" HorizontalAlign="Center"
                BorderWidth="1px" BorderColor="White" />
            <ItemStyle HorizontalAlign="Center" />
            <MasterTableView GridLines="None" CommandItemDisplay="Top" DataKeyNames="ProjectId"
                HorizontalAlign="Center" AllowFilteringByColumn="true">
                <CommandItemTemplate>
                    <table style="width: 100%">
                        <tr>
                            <td align="right" style="width: 80%">
                                <asp:LinkButton ID="lnkshwFilter" Text="ShowFilter" Font-Underline="true" ForeColor="MidnightBlue"
                                    runat="server" OnClientClick="return showFilterItem()" />
                                <asp:LinkButton ID="lnkhdFilter" Text="HideFilter" Font-Underline="true" ForeColor="MidnightBlue"
                                    runat="server" OnClientClick="return hideFilterItem()" />
                            </td>
                            <td align="right" style="height: 10px;">
                                Total Records found: <asp:Label ID="lblTotRecCount" runat="server" Font-Bold="True"
                                    Font-Size="10pt" ForeColor="Black" Text="0"></asp:Label>
                            </td>
                            <td align="right" style="width: 5%">
                                    
                                <asp:ImageButton ID="ExportToExcelButton" runat="server" ImageUrl="~/images/ExportToExcel.gif"
                                    ToolTip="Export to Excel" OnClick="ExportExcel_Click" />
                            </td>
                        </tr>
                    </table>
                </CommandItemTemplate>
                <Columns>
                    ........ some columns here.......
                </Columns>
                <ItemStyle ForeColor="#3C5F22" Font-Size="8pt" BackColor="White" BorderWidth="0px"
                    BorderColor="White" />
                <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />
            </MasterTableView>
            <ClientSettings AllowColumnsReorder="true">
                <ClientEvents OnGridCreated="GridCreated" />
                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                <Resizing AllowColumnResize="true" />
            </ClientSettings>
        </telerik:RadGrid>
    </div>


function showFilterItem() {
    $find('<%=gvPjtMnt.ClientID %>').get_masterTableView().showFilterItem();
    document.getElementById('ctl00_PagePlaceholder_gvPjtMnt_ctl00_ctl02_ctl00_lnkhdFilter').style.display = 'block';
    document.getElementById('ctl00_PagePlaceholder_gvPjtMnt_ctl00_ctl02_ctl00_lnkshwFilter').style.display = 'none';
    return false;
 
}
function hideFilterItem() {
    document.getElementById('ctl00_PagePlaceholder_gvPjtMnt_ctl00_ctl02_ctl00_lnkhdFilter').style.display = 'none';
    document.getElementById('ctl00_PagePlaceholder_gvPjtMnt_ctl00_ctl02_ctl00_lnkshwFilter').style.display = 'block';
    $find('<%=gvPjtMnt.ClientID %>').get_masterTableView().hideFilterItem();
    return false;
}
function GridCreated(sender, args) {
    sender.get_masterTableView().hideFilterItem();
}

protected void gvPjtMnt_ItemCreated(object sender, GridItemEventArgs e)
    {
        try
        {
            if (e.Item is GridCommandItem)
            {
               LinkButton st = (LinkButton)e.Item.FindControl("lnkhdFilter");
               st.Style["display"] = "none";
            }
        }
        catch (Exception ex)
        {
        }
 
    }
Dimo
Telerik team
 answered on 17 Sep 2010
1 answer
314 views
Hi,

I have radgrid with show and hide filter options. Initially filter is disabled. When i click show filter button it is displaying the filter but pageritem in the bottom is not displaying if i click hide button the pageritem is displaying. (Please see the Iamges) I set " PagerStyle-AlwaysVisible="true" ". But still no luck. Can anyone help me how to fix this? Here is my code

function showFilterItem() {
    $find('<%=gvPjtMnt.ClientID %>').get_masterTableView().showFilterItem();
    document.getElementById('ctl00_PagePlaceholder_gvPjtMnt_ctl00_ctl02_ctl00_lnkhdFilter').style.display = 'block';
    document.getElementById('ctl00_PagePlaceholder_gvPjtMnt_ctl00_ctl02_ctl00_lnkshwFilter').style.display = 'none';
    return false;
 
}
function hideFilterItem() {
    document.getElementById('ctl00_PagePlaceholder_gvPjtMnt_ctl00_ctl02_ctl00_lnkhdFilter').style.display = 'none';
    document.getElementById('ctl00_PagePlaceholder_gvPjtMnt_ctl00_ctl02_ctl00_lnkshwFilter').style.display = 'block';
    $find('<%=gvPjtMnt.ClientID %>').get_masterTableView().hideFilterItem();
    return false;
}
function GridCreated(sender, args) {
    sender.get_masterTableView().hideFilterItem();
}

<div style="width: 98%; overflow: auto; overflow-y: hidden">
                                            <telerik:RadGrid ID="gvPjtMnt" runat="server" Height="600px" AutoGenerateColumns="false"
                                                BorderWidth="2px" BorderStyle="Solid" BackColor="White" AllowPaging="True" PagerStyle-AlwaysVisible="true"
                                                PageSize="20" AllowSorting="True" AllowFilteringByColumn="true" OnNeedDataSource="gvPjtMnt_OnNeedDataSource"
                                                OnItemCommand="gvPjtMnt_ItemCommand" OnItemCreated="gvPjtMnt_ItemCreated" EnableViewState="true">
                                                <HeaderStyle Height="20px" BackColor="#004000" Font-Size="8pt" Font-Bold="True" ForeColor="White"
                                                    HorizontalAlign="Center" BorderColor="White" BorderWidth="1px" />
                                                <AlternatingItemStyle Font-Size="8pt" BackColor="#F5F5E9" HorizontalAlign="Center"
                                                    BorderWidth="1px" BorderColor="White" />
                                                <ItemStyle HorizontalAlign="Center" />
                                                <MasterTableView GridLines="None" CommandItemDisplay="Top" DataKeyNames="ProjectId"
                                                    HorizontalAlign="Center" AllowFilteringByColumn="true">
                                                    <CommandItemTemplate>
                                                        <table style="width: 100%">
                                                            <tr>
                                                                <td align="right" style="width: 80%">
                                                                    <asp:LinkButton ID="lnkshwFilter" Text="ShowFilter" Font-Underline="true" ForeColor="MidnightBlue"
                                                                        runat="server" OnClientClick="return showFilterItem()" />
                                                                    <asp:LinkButton ID="lnkhdFilter" Text="HideFilter" Font-Underline="true" ForeColor="MidnightBlue"
                                                                        runat="server" OnClientClick="return hideFilterItem()" />
                                                                </td>
                                                                <td align="right" style="height: 10px;">
                                                                    Total Records found: <asp:Label ID="lblTotRecCount" runat="server" Font-Bold="True"
                                                                        Font-Size="10pt" ForeColor="Black" Text="0"></asp:Label>
                                                                </td>
                                                                <td align="right" style="width: 5%">
                                                                        
                                                                    <asp:ImageButton ID="ExportToExcelButton" runat="server" ImageUrl="~/images/ExportToExcel.gif"
                                                                        ToolTip="Export to Excel" OnClick="ExportExcel_Click" />
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </CommandItemTemplate>
                                                    <Columns>
                                                        <telerik:GridBoundColumn DataField="ProjectId" UniqueName="ProjectId" Visible="false">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="LOB" DataField="LOB" UniqueName="LOB">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Division Name" DataField="Division" UniqueName="Division">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Region Name" DataField="MarketName" UniqueName="MarketName">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Project Name" DataField="ProjectName" UniqueName="ProjectName">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Project Manager Name" DataField="ProjectMgrName"
                                                            UniqueName="ProjectMgrName">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Number Of Sites Received" DataField="NumSitesReceived"
                                                            UniqueName="NumSitesReceived">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Accept Service Order Date" DataField="AcceptServiceOrderTaskCompleteDate"
                                                            UniqueName="AcceptServiceOrderTaskCompleteDate" DataFormatString="{0:MM/dd/yyyy}">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="PTD" DataField="PTD" UniqueName="PTD" DataFormatString="{0:MM/dd/yyyy}">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Health Reason" DataField="HealthReason" UniqueName="HealthReason">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Project Health" DataField="ProjectHealth" UniqueName="ProjectHealth">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Customer Signed Date" DataField="CustomerSignedDate"
                                                            UniqueName="CustomerSignedDate" DataFormatString="{0:MM/dd/yyyy}">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="OA Complete Date" DataField="OACompleteDate"
                                                            UniqueName="OACompleteDate" DataFormatString="{0:MM/dd/yyyy}">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Customer Requested Due Date" DataField="CustomerRequestedDueDate"
                                                            UniqueName="CustomerRequestedDueDate" DataFormatString="{0:MM/dd/yyyy}">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="Last Note Added" DataField="LastNoteAdded" UniqueName="LastNoteAdded">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridTemplateColumn UniqueName="EditRows" HeaderStyle-Width="3%" ItemStyle-Width="3%"
                                                            AllowFiltering="false">
                                                            <ItemTemplate>
                                                                <asp:ImageButton runat="server" ID="EditPMTsk" CommandName="EditRow" ImageUrl="Images/edit-icon.png"
                                                                    ImageAlign="Middle" ToolTip="Edit Task" />
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                    </Columns>
                                                    <ItemStyle ForeColor="#3C5F22" Font-Size="8pt" BackColor="White" BorderWidth="0px"
                                                        BorderColor="White" />
                                                    <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />
                                                </MasterTableView>
                                                <ClientSettings AllowColumnsReorder="true">
                                                    <ClientEvents OnGridCreated="GridCreated" />
                                                    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                                    <Resizing AllowColumnResize="true" />
                                                </ClientSettings>
                                            </telerik:RadGrid>
                                        </div>

protected void gvPjtMnt_ItemCreated(object sender, GridItemEventArgs e)
{
    try
    {
        if (e.Item is GridCommandItem)
        {
           LinkButton st = (LinkButton)e.Item.FindControl("lnkhdFilter");
           st.Style["display"] = "none";
        }
    }
    catch (Exception ex)
    {
    }
 
}


Thanks.
Dimo
Telerik team
 answered on 17 Sep 2010
1 answer
105 views
Our company filters out Facebook and I don't want to get an exception log for each message I visit on Telerik post!

Atanas
Telerik team
 answered on 17 Sep 2010
2 answers
110 views
Hello

I want to add different icons to the events and categorize them. I want to display the icons in the scheduler. Is there a way to do that?

Thank you

NLV
NLV
Top achievements
Rank 1
 answered on 17 Sep 2010
1 answer
114 views
I have placed a radScheduler on a web page and hooked it up to linq-to-entities that is interfacing to a table called Appointments.  I have all the fields I need to do CRUD operations but when I try to add an appointment by double-clicking on a day and then simply entering a value and clicking Save, I get this error:

"Error: Sys.WebForms.PageRequestManagerServerErrorException: A property named 'RecurrenceParentId' was not found on the entity during an insert, update, or delete operation. Check to ensure that properties specified as binding expressions are available to the data source."

My entity includes the field, "RecurrenceParentId", so I am not quite sure what this error is or how to solve it.  My mark-up code is shown below.  there is no code in the code-behind as I am interacing to the entity.

<telerik:RadScheduler runat="server" ID="radSchAppointments" Width="1100px" Height="700px"
    DayStartTime="08:00:00" DayEndTime="20:00:00" TimeZoneOffset="03:00:00" 
    DataKeyField="ID" DataSubjectField="Subject"
    DataStartField="Start" DataEndField="End" DataRecurrenceField="RecurrenceRule"
    DataRecurrenceParentKeyField="RecurrenceParentId" 
    DataSourceID="edsAppointments" SelectedView="MonthView">
    <AdvancedForm Modal="true" />
    <TimelineView UserSelectable="false" />
    <TimeSlotContextMenuSettings EnableDefault="true" />
    <AppointmentContextMenuSettings EnableDefault="true" />
</telerik:RadScheduler>
<asp:EntityDataSource ID="edsAppointments" runat="server" ConnectionString="name=StoneFalconEntities"
    DefaultContainerName="StoneFalconEntities" EnableDelete="True" EnableInsert="True"
    EnableUpdate="True" EntitySetName="Appointments">
</asp:EntityDataSource>

and here is my table called Appointments:

CREATE TABLE [dbo].[Appointments](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [Subject] [nvarchar](200) NULL,
    [Start] [datetime] NULL,
    [End] [datetime] NULL,
    [RoomID] [int] NULL,
    [UserID] [int] NULL,
    [RecurrenceRule] [nvarchar](50) NULL,
    [RecurrenceParentID] [int] NULL,
 CONSTRAINT [PK_Appointments] PRIMARY KEY CLUSTERED


Iker Llanos
Top achievements
Rank 1
 answered on 17 Sep 2010
2 answers
185 views
Hi,

I'm having a lot of trouble getting the vanilla RangeValidator and RequireFieldValidator to work with the RadDatePicker from the classic suite of controls.

And the ValidationSummary as well.

Are there any tutorials on this?
David
Top achievements
Rank 1
 answered on 17 Sep 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?