Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
374 views

Hi,

I am new to Telerik. Not sure whether the below code is accurate since Edit link or Edit button is not appearing on the screen. The grid records gets populated but on the edit column ,the word edit is not appearing . Please find the below code

<telerik:RadGrid RenderMode="Lightweight" ID="RadGVCurrent" runat="server"
AllowAutomaticUpdates="True"
OnUpdateCommand="RadGVCurrent_UpdateCommand"
GridLines="Both" GroupPanelPosition="Top" IsExporting="False" >
<GroupingSettings CollapseAllTooltip="Collapse all groups" />
<MasterTableView AutoGenerateColumns="False" DataKeyNames="ID" >
<Columns>
<telerik:GridEditCommandColumn >
</telerik:GridEditCommandColumn>

<telerik:GridTemplateColumn UniqueName="Post"
FilterControlAltText="Filter Post column">
<ItemTemplate>
<asp:Button ID="btnGrdPost" runat="server" CommandName="Post" Text="Post"
OnClick="Post_Click" Font-Names="Calibri" Font-Size="X-Small"
Height="20px" Width="50px" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Void" FilterControlAltText="Filter Void column" >
<ItemTemplate>
<asp:Button ID="btnGrdVoid" runat="server" CommandName="Void" Text="Void"
Height="20px" Width="50px"
OnClick="Void_Click" Font-Names="Calibri" Font-Size="X-Small" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="ID"
FilterControlAltText="Filter ID column" ></telerik:GridBoundColumn>
<telerik:GridTemplateColumn UniqueName="EditStartDt"
FilterControlAltText="Filter TemplateColumn2 column" >
<EditItemTemplate>
<table><tr><td><asp:TextBox ID="txtGrdStartDT" runat="server" Font-Names="Calibri" Font-Size="X-Small" Height="22px" ReadOnly="true" style="margin-left: 0px"
Width="74px"></asp:TextBox>
<asp:Calendar ID="calGrdCalendar" runat="server" BackColor="#F7F6F3"
BorderColor="#003399" BorderWidth="1px" DayNameFormat="Shortest"
Font-Names="Calibri" Font-Size="XX-Small" ForeColor="#284775" Height="88px"
OnDayRender="calGrdCalendar_DayRender"
OnSelectionChanged="calGrdCalendar_OnSelectionChanged" ShowGridLines="True"
style="margin-right: 0px; margin-top: 1px; margin-bottom: 0px; margin-left: 0px;"
Width="74px" SelectedDate='<%# Bind("Startdt") %>'><SelectedDayStyle BackColor="#999999" Font-Bold="True" /><SelectorStyle
BackColor="#CC3399" /><OtherMonthDayStyle ForeColor="#284775" /><NextPrevStyle
Font-Size="9pt" ForeColor="Silver" /><DayHeaderStyle BackColor="#CCCCCC"
Font-Bold="True" Height="1px" /><TitleStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="9pt"
ForeColor="White" /></asp:Calendar></td></tr></table></EditItemTemplate><ItemTemplate><table><tr><td>
<asp:Label ID="lblStartDT" runat="server" Text='<%# Bind("StartDT") %>'
Width="80px"></asp:Label></td></tr><tr><td><asp:Label ID="lblchk" runat="server" Text="Lv Extn"></asp:Label>
</td><td><asp:CheckBox ID="chk1" runat="server" AutoPostBack="true"
oncheckedchanged="chk1_CheckedChanged"
ToolTip="Allow start leave on weekends or holidays for those extended their leave" /></td></tr></table>
</ItemTemplate><ItemStyle HorizontalAlign="Right" Width="15%" />
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="EditEndDt"
FilterControlAltText="Filter TemplateColumn2 column" >
<EditItemTemplate><table><tr><td><asp:TextBox ID="txtGrdEndDT" runat="server" style="margin-left: 0px" Width="65px"
ReadOnly="true" Height="22px" Font-Names="Calibri" Font-Size="X-Small" ></asp:TextBox>
<asp:Calendar ID="calGrdCalendar2" OnDayRender="calGrdCalendar2_DayRender"
runat="server" OnSelectionChanged="calGrdCalendar2_OnSelectionChanged"
Height="88px" Width="66px"
style="margin-right: 0px; margin-top: 1px; margin-bottom: 0px; margin-left: 0px;" BackColor="#F7F6F3"
BorderColor="#003399" BorderWidth="1px" DayNameFormat="Shortest" Font-Names="Calibri"
Font-Size="XX-Small" ForeColor="#284775" ShowGridLines="True" ><SelectedDayStyle BackColor="#999999" Font-Bold="True" /><SelectorStyle BackColor="#CC3399" /><OtherMonthDayStyle ForeColor="#284775" /><NextPrevStyle
Font-Size="9pt" ForeColor="Silver" /><DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Height="1px" /><TitleStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="9pt" ForeColor="White" /></asp:Calendar></td></tr></table>
</EditItemTemplate>
<ItemTemplate><asp:Label ID="lblEndDT" runat="server" Width="80px" Text='<%#Eval("EndDT") %>'/></ItemTemplate><ItemStyle HorizontalAlign="Right" Width="15%" />
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Type"
FilterControlAltText="Filter TemplateColumn2 column" >
<EditItemTemplate><asp:DropDownList AutoPostBack="true" ID="ddlGrdAtnType" runat="server" Width="80px"
Font-Names="Calibri" Font-Size="X-Small"
onselectedindexchanged="ddlGrdAtnType_SelectedIndexChanged" ></asp:DropDownList>
</EditItemTemplate>
<ItemTemplate><asp:Label ID="lblGrdAtendnce" runat="server" Text='<%# Bind("Type") %>' ></asp:Label></ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Days"
FilterControlAltText="Filter Days column" >
<ItemTemplate><asp:Label ID="lblDays" runat="server" Font-Names="Calibri" Font-Size="X-Small"
Text='<%# String.Format("{0:f2}",DataBinder.Eval(Container.DataItem, "Days")) %>' /></ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Days"
FilterControlAltText="Filter Days column" >
<ItemTemplate><asp:Label ID="lblDays" runat="server" Font-Names="Calibri" Font-Size="X-Small"
Text='<%# String.Format("{0:f2}",DataBinder.Eval(Container.DataItem, "Days")) %>' /></ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Holi"
FilterControlAltText="Filter Holi column" >
<ItemTemplate><asp:Label ID="lblHols" runat="server"
Text='<%# String.Format("{0:f2}",DataBinder.Eval(Container.DataItem, "Holidays")) %>'
/></ItemTemplate> <HeaderStyle HorizontalAlign="Left" Width="20px" />
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="Status" HeaderText="Status"
FilterControlAltText="Filter Status column" UniqueName="Status" ></telerik:GridBoundColumn>
<telerik:GridTemplateColumn UniqueName="Annu"
FilterControlAltText="Filter Annu column" >
<ItemTemplate><asp:Label ID="lblDaysAnnual" runat="server"
Text='<%# String.Format("{0:f2}",DataBinder.Eval(Container.DataItem, "Annual")) %>'
/></ItemTemplate><HeaderStyle HorizontalAlign="Left" Width="25px" /><ItemStyle HorizontalAlign="Right"
Font-Names="Calibri" Font-Size="X-Small" />
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="Notes" HeaderText="Remarks"
FilterControlAltText="Filter Notes column" UniqueName="Notes" >
</telerik:GridBoundColumn>


</Columns>

<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn1 column"
UniqueName="EditCommandColumn1" >
</EditColumn>
</EditFormSettings>


</MasterTableView>
<FilterMenu RenderMode="Lightweight">
</FilterMenu>
<HeaderContextMenu RenderMode="Lightweight">
</HeaderContextMenu>
</telerik:RadGrid>

Thanks

Pavlina
Telerik team
 answered on 11 Apr 2016
13 answers
705 views
Hello, I have a grid column where items look like this: "Insulation - 02 - 1 - 15000". The problem is if for that column filter I put in a number and select contains it returns nothing.
Eyup
Telerik team
 answered on 11 Apr 2016
1 answer
121 views

Hi!

I wanted to modify style of RadCombo on server side, something like this:

01.protected void SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
02.    {
03.        var radCombo = sender as RadComboBox;
04.        var parent = radCombo.Parent;
05. 
06.       // cuted...
07. 
08.        int constLeft = 130;
09.        int avgTokenWidth = 73;
10.        int computed = constLeft + (avgTokenWidth * autocomplete.Entries.Count);
11.        radCombo.Style["Left"] = computed.ToString() + " px ! important";
12.    }

 

But it doesn't do anything. How to push these change to the client?

 

Eyup
Telerik team
 answered on 11 Apr 2016
1 answer
59 views

I am trying to get inline popup working but for some resson its displaying nothing no editable fields for the user the insert and cancel are showing fine. I have made sure to have ajax manager and a ajax loader as per demo

 

01.<telerik:RadAjaxManager ID="RadAjaxManager2" runat="server">
02.       <AjaxSettings>
03.           <telerik:AjaxSetting AjaxControlID="rpNotes">
04.               <UpdatedControls>
05.                   <telerik:AjaxUpdatedControl ControlID="rpNotes" LoadingPanelID="RadAjaxLoadingPanel1" />
06.               </UpdatedControls>
07.           </telerik:AjaxSetting>
08.       </AjaxSettings>
09.   </telerik:RadAjaxManager>
10.                           <telerik:RadAjaxPanel ID="rpNotes" runat="server">
11.                                 <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
12.                               <telerik:RadGrid ID="rgNotes" runat="server" GroupPanelPosition="Top" Skin="Bootstrap">
13.                                   <GroupingSettings CollapseAllTooltip="Collapse all groups"></GroupingSettings>
14.                                   <MasterTableView NoDetailRecordsText="No notes for this Appointment" AutoGenerateColumns="False" CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText="Add Notes" AllowAutomaticInserts="true" EditMode="InPlace">
15.                                       <Columns>
16.                                             <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
17.                   </telerik:GridEditCommandColumn>
18.                                           <telerik:GridBoundColumn DataField="Subject" FilterControlAltText="Filter Subject column" HeaderText="subject" ReadOnly="True" SortExpression="Subject" UniqueName="Subject">
19.                                           </telerik:GridBoundColumn>
20.                                       </Columns>
21.                                   </MasterTableView>
22.                               </telerik:RadGrid>
23.                           </telerik:RadAjaxPanel>
24.                           <div></div>
25.                       </div>
26.                       <br />

I am filling my rad grid using dal access which is the following routine.

 

01./// <summary>
02./// Gets the allnotes by appointment.
03./// </summary>
04./// <param name="id">The identifier.</param>
05./// <returns></returns>
06.public List<tblApertureNetNote> getNotesByAppointment(int id)
07.{
08.    try
09.    {
10.        var _notes = apertureNetEntities.tblApertureNetNotes.Where(f => f.isDeleted == false && f.appointment_id == id).OrderByDescending(o => o.authCreatedDate).ToList();
11.        return _notes.AsQueryable().ToList();
12.    }
13.    catch (Exception ex)
14. 
15.    {
16.        string inner = string.Empty;
17.        if (ex.InnerException != null)
18.        {
19.            inner = ex.InnerException.ToString();
20.        }
21.        logger.Error("Error in IQueryable function getNotesByAppointment " + ex.ToString() + " " + inner);
22.        return null;
23.    }
24.}

Eyup
Telerik team
 answered on 11 Apr 2016
1 answer
70 views

Hi,

I am trying to use the Rad Searchbox as in example: http://demos.telerik.com/aspnet-ajax/searchbox/examples/overview/defaultcs.aspx

I have added the similar code, but the rad search box is throwing error as "Unknown element".

How to use the Rad Searchbox?

Thanks

Veselin Tsvetanov
Telerik team
 answered on 11 Apr 2016
5 answers
284 views

Hi,

I am using the scheduler control for a project, and I am quite new to it, your guidance on below 3 problems would be very helpful.

I have a list of free time, and time booked for appointment etc. Now based on this the remaining timeslots should be disabled. 
i.e. for example if for today I have my time available from say 9:00 AM to 10:00AM then an appointment from 10:00AM to 12:AM and then a available time from 12:PM to 3:00PM . except for these time the remaining timeslots should be disabled. How can I achieve this.

I am loading the appointment from the server side, hence using the TimeSlotCreated event I was not able to change the timeslots.

Also if you can help me on how to add a tooltip to the available timeslots(in the above example 9:00AM to 10:00AM, I have to show a tool tip as say "available from 9:00AM - 10:00AM".

 

Third how can I clear a scheduler, say today I have data in scheduler horizontally 3 users in header and each having some appointment, when I move to next day if there are no users and no appointment, I want to clear the scheduler so that the old data is removed. I Tried to clear using below code, but still the see that the header and appointment persist.

DiarySchedule.ResourceTypes.Clear();
Appointments.Clear();
DiarySchedule.DataKeyField = "ID";
DiarySchedule.DataStartField = "Start";
DiarySchedule.DataEndField = "End";
DiarySchedule.DataSubjectField = "Subject";
DiarySchedule.DataDescriptionField = "Description";
DiarySchedule.DataRecurrenceField = "RecurrenceRule";
DiarySchedule.DataRecurrenceParentKeyField = "RecurrenceParentID";
DiarySchedule.DataSource = Appointments;


Thank you

Arvind

 

Ibrahim
Top achievements
Rank 1
 answered on 11 Apr 2016
3 answers
103 views
I have the following telerik grid and need to pass the data value from the nested table into the ItemCommand so when
the user clicks the grid button the code is executed I am stuck on where to go with this

<telerik:RadGrid ID="grdRegions" runat="server" Skin="Metro" AllowCustomSorting="True"
                ShowHeader="True" PageSize="10" ShowGroupPanel="False"     OnItemCommand="grdRegions_ItemCommand"
                ShowStatusBar="True" AutoGenerateColumns="False"
                AllowSorting="True" AllowPaging="True" DataSourceID="RegionDS" Width="500px">
                <PagerStyle Mode="Slider" />
                <MasterTableView DataSourceID="RegionDS" DataKeyNames="RegionCode" AllowMultiColumnSorting="True" Width="100%">

                    <DetailTables>
                        <telerik:GridTableView runat="server" DataKeyNames="RegionCode,DealerId" DataSourceID="DealerDS" AllowFilteringByColumn="True" >
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="RegionCode" MasterKeyField="RegionCode"  />
                            </ParentTableRelation>
                            <Columns>
                                <telerik:GridBoundColumn SortExpression="DealerId" HeaderText="Dealer" HeaderButtonType="TextButton"
                                    DataField="Dealer" UniqueName="DealerId">
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn SortExpression="RegionCode" HeaderText="FDAF Region Code" HeaderButtonType="TextButton"
                                    DataField="RegionCode" UniqueName="RegionCode" AllowFiltering="False">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="DealerId" HeaderText="DealerId" HeaderButtonType="TextButton"
                                    DataField="DealerId" UniqueName="Dealer">
                                </telerik:GridBoundColumn>
                               <telerik:GridTemplateColumn ItemStyle-Width="22px" AllowFiltering="false">
                                <ItemTemplate>
                                    <asp:ImageButton ID="EditDealer" runat="server" AlternateText="Edit Dealer" ToolTip="Edit Dealer"
                                        ImageUrl="Images/edit.png" CommandArgument='<%# DataBinder.Eval(Container,"DataItem.DealerId")%>'
                                        CommandName="EditDealer" CausesValidation="false" />
                                </ItemTemplate>
                                <ItemStyle Width="22px"></ItemStyle>
                            </telerik:GridTemplateColumn>
                            </Columns>
                        </telerik:GridTableView>
                    </DetailTables>
                    <Columns>
                        <telerik:GridBoundColumn SortExpression="RegionName" HeaderText="FDAF Region" HeaderButtonType="TextButton"
                            DataField="RegionName" UniqueName="RegionName" AllowFiltering="False">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn SortExpression="RegionCode" HeaderText="FDAF Region Code" HeaderButtonType="TextButton"
                            DataField="RegionCode" UniqueName="RegionCode">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn SortExpression="RegionDealerCount" HeaderText="Dealers In Region" HeaderButtonType="TextButton"
                            DataField="RegionDealerCount" UniqueName="RegionDealerCount" AllowFiltering="False">
                        </telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>






                     protected void grdRegions_ItemCommand(object sender, GridCommandEventArgs e)
                        {
                            objDealerDL.DealerId = Convert.ToInt32((e.Item as GridDataItem).OwnerTableView.DataKeyValues[e.Item.ItemIndex]["DealerId"].ToString());
                            GridDataItem item = (GridDataItem)e.Item;                       
                            if (e.CommandName == "EditDealer")
                            {
                                try
                                {
                                  do work
                                }
                                catch (Exception ex)
                                {

                                }
                            }
                        }
Eyup
Telerik team
 answered on 11 Apr 2016
5 answers
225 views
When you click and open a radgrid date picker, you need to click on the date at top to get another window to open so that you can pick the button with todays date.

1.  How do you seet that button with todays date.  I went into the properties but can never find the right syntax for it to take.
2. Is there a way to put it on the datepicker at the bottom such as the Microsoft one that has it at the bottom so there is no need to pick agian to get to todays date button.
Eyup
Telerik team
 answered on 11 Apr 2016
3 answers
81 views

Hi

I am new to Telerik I am looking for working independent sample  project or web site of Scheduler - Resource Grouping (http://demos.telerik.com/aspnet-ajax/scheduler/examples/resourcegrouping/defaultcs.aspx?skin=Silk).  Where can I download such a sample?

Thanks

abahrami

Nencho
Telerik team
 answered on 11 Apr 2016
2 answers
168 views

Hi,

We are using Telerik Web UI for AJAX (version 2015.2.729.45). In grid we have data with double quotes (") and filter control is TextBox. Searching text with double quotes fails the search.

please see the attachment.

Code being used - Using the aspx standard script.

 <telerik:GridBoundColumn DataField="Name" HeaderText="Header" UniqueName="Name" FilterControlWidth="260px" AllowFiltering="true" ShowFilterIcon="false" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" />

Kindly let us know for the solution.

Thanks.

Neelesh

Eyup
Telerik team
 answered on 11 Apr 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?