Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
98 views

I have about 20 or so columns. I am looking for a way to lay them out in Edit or Add New Record (EdititemTemplate) so they are not all in a vertical line. Normaly I would use tables but since I am using the GridTemplateCoumn I am not sure how to create a layout. Here is a sample. I would like the text boxes to display the first 10 or so on the left and the last 10 on the right. Can I use tables  with the GridTemplateColumns? Yeah I am new to Telerik and somewhat new to Web Dev.

 Thanks in advance.

 

<telerik:GridTemplateColumn DataField="Last_Name" HeaderText="Last Name" SortExpression="Last_Name" UniqueName="Last_Name">
                   <EditItemTemplate>
                       <div>
                       <asp:TextBox runat="server" ID="Last_NameTextBox" Text='<%# Bind("Last_Name") %>'></asp:TextBox>
                   </div>
                           </EditItemTemplate>
                   <ItemTemplate>
                       <asp:Label runat="server" ID="Last_NameLabel" Text='<%# Eval("Last_Name") %>'></asp:Label>
                   </ItemTemplate>
                   <FilterTemplate>
                       <telerik:RadComboBox ID="LastNameComboFilter" runat="server" DataSourceID="SqlDataSourceLastName"
                           DataTextField="Last_Name" DataValueField="Last_Name" AppendDataBoundItems="True"
                           SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Last_Name").CurrentFilterValue %>'
                           OnClientSelectedIndexChanged="Last_NameChanged"
                           MarkFirstMatch="True"
                           Filter="StartsWith"
                           AllowCustomText="True" Width="110px">
                           <Items>
                               <telerik:RadComboBoxItem Text="All" />
                           </Items>
                       </telerik:RadComboBox>
                       <telerik:RadScriptBlock ID="RadScriptBlockLastName" runat="server">
                           <script type="text/javascript">
                               function Last_NameChanged(sender, args) {
                                   var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                   tableView.filter("Last_Name", args.get_item().get_value(), "EqualTo");
                               }
                           </script>
                       </telerik:RadScriptBlock>
                   </FilterTemplate>
               </telerik:GridTemplateColumn>


               <telerik:GridTemplateColumn DataField="First_Name" HeaderText="First Name" SortExpression="First_Name" UniqueName="First_Name">
                   <EditItemTemplate>
                       <asp:TextBox runat="server" ID="First_NameTextBox" Text='<%# Bind("First_Name") %>'></asp:TextBox>
                   </EditItemTemplate>
                   <ItemTemplate>
                       <asp:Label runat="server" ID="First_NameLabel" Text='<%# Eval("First_Name") %>'></asp:Label>
                   </ItemTemplate>
                   <FilterTemplate>
                       <telerik:RadComboBox ID="FirstNameComboFilter" runat="server" DataSourceID="SqlDataSourceFirstName"
                           DataTextField="First_Name" DataValueField="First_Name" AppendDataBoundItems="True"
                           SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("First_Name").CurrentFilterValue %>'
                           OnClientSelectedIndexChanged="First_NameChanged"
                           MarkFirstMatch="True"
                           Filter="StartsWith"
                           AllowCustomText="True" Width="110px">

                           <Items>

                               <telerik:RadComboBoxItem Text="All" />

                           </Items>

                       </telerik:RadComboBox>
                       <telerik:RadScriptBlock ID="RadScriptBlockFirstName" runat="server">
                           <script type="text/javascript">
                               function First_NameChanged(sender, args) {
                                   var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                   tableView.filter("First_Name", args.get_item().get_value(), "EqualTo");
                               }
                           </script>
                       </telerik:RadScriptBlock>
                   </FilterTemplate>
  
               </telerik:GridTemplateColumn>

Konstantin Dikov
Telerik team
 answered on 03 Jun 2015
2 answers
135 views

Hello,

 

Having a bit of an odd issue where the styling is changing on a RadGrid after rebinding. To begin with its starting with the first row rendered above the bottom of the header row - which isn't ideal as well as showing a blank footer bar. Afterwards the top row is rendered correctly under the header row and the blank footer bar has disappeared.

 

Any idea what this could be?

Images attached and code below: -

 

<div style="horiz-align: center">
            <span style="text-align: center; font-size: large; padding-bottom: 15px;">Please select the relevant campaign: -</span>
            <div style="padding-bottom: 5px;">Search Campaigns: <asp:TextBox ID="CampaignFilter" AutoPostBack="true" runat="server"/><span style="padding-left: 5px;"><asp:button runat="server" Text="Search" id="SearchButton" OnClick="SearchButtonOnClick" /></span></div>
            <telerik:RadGrid ID="CampaignGrid" runat="server" OnNeedDataSource="CampaignGridNeedDataSource" 
                AllowPaging="False" Skin="WebBlue" Height="350px">
                <ClientSettings EnableRowHoverStyle="True" Scrolling-UseStaticHeaders="True" Scrolling-AllowScroll="True">
                    <ClientEvents OnRowClick="CampaignRowClicked" />
                </ClientSettings>
                <MasterTableView AutoGenerateColumns="False" AllowSorting="False" AllowFilteringByColumn="False" TableLayout="Fixed">
                    <Columns>
                        <telerik:GridTemplateColumn DataField="Name" SortExpression="Name" HeaderText="Campaign Name" UniqueName="Name">
                            <ItemTemplate>
                                <div class="TableCellNoOverflow" id="CampaignName"><%# Eval("Name") %></div>
                                <asp:HiddenField runat="server" ID="HdnCampaignId" Value='<%# Eval("Id") %>'/>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </div>

 

 

protected void CampaignGridNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        List<DataRow> campaigns = Campaigns.AsEnumerable().ToList();
        campaigns = campaigns.Where(r => ((string) r["Name"]).ToUpper().Contains(CampaignFilter.Text.ToUpper())).ToList();
        if(campaigns.Count > 0)
            CampaignGrid.DataSource = campaigns.CopyToDataTable();
        else
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("Name");
            CampaignGrid.DataSource = dt;
        }
    }
 
    protected void SearchButtonOnClick(object sender, EventArgs e)
    {
        CampaignGrid.Rebind();
    }

 

Maria Ilieva
Telerik team
 answered on 03 Jun 2015
5 answers
154 views

Hello all,

Is it possible to display a custom "Edit task" page?

For example: I  would like to either :

1. Display my own modal popup "Edit Task" page to capture lots of extra task information, save it to the database (using a custom provider ) and then refresh the Gantt task line, or

2. On double click, navigate to a custom "Edit Task"  page, then on "Save" go back to the Gantt page.  

Chris.

 

Nencho
Telerik team
 answered on 03 Jun 2015
1 answer
102 views

Hi,

I am planning to use RadFileExplorer and it's build in RadAsyncUpload. I have a requirement to open multiple RadAsyncUpload dialogs at the same time.

Let's say one is for parent folder and the other one is for the subfolder in the parent folder.  Is it possible?

 

Thanks

Ivan Danchev
Telerik team
 answered on 03 Jun 2015
1 answer
1.2K+ views

Hi,

I try to bind an attribute to a ASP.NET Textbox in a ListBox.

However I get the error ​"Server tag is not well formed"

<asp:TextBox runat="server" Text="<%# DataBinder.Eval(Container, "Attributes['page_template_name']")%>" />

When I try to follow the way in this older thread: http://www.telerik.com/forums/server-tag-is-not-well-formed-with-trying-to-assign-am-attribute-to-a-text-field, by escaping the quotes, I still get the same error.

What is the correct way to bind the attribute?

Thanks.

 

XiMnet Malaysia
Top achievements
Rank 1
 answered on 03 Jun 2015
1 answer
116 views

Hi!

Are there any news regarding to the problem described here:
http://www.telerik.com/forums/radgrid-model-binding-selectmethod-fires-twice#_kZEWgTau0KuyscVphStNQ

Thanks in advance!

Chris

Konstantin Dikov
Telerik team
 answered on 03 Jun 2015
5 answers
269 views
Hi.

In some cases using IE11, if NumberFormat / GroupSeparator is present, it counts in the MaxValue validation.
For example:
If MaxValue is set to 11 and GroupSeparator to ".", and you type 99999999999 (11 characters) --> 99.999.999.999 (14 characters)
It's marked as invalid.
In Chrome it's fine.

Can you please check it.
Best regards.
Kostadin
Telerik team
 answered on 03 Jun 2015
2 answers
260 views

Hi,

I have a grid declared as follows:

    <telerik:RadGrid ID="grdTimeSheets" runat="server">
        <MasterTableView>
            <Columns>
                <telerik:GridButtonColumn ButtonType="PushButton" CommandName="Update" FilterControlAltText="Filter colButtonUpdate column" Text="Update" UniqueName="grdTimeSheetscolEditRecordButton" />
                <telerik:GridButtonColumn ButtonType="PushButton" CommandName="Delete" FilterControlAltText="Filter colButtonDelete column" Text="Delete" UniqueName="grdTimeSheetscolDeleteRecordButton" />
                <telerik:GridBoundColumn DataField="UserName" FilterControlAltText="Filter By User Name" UniqueName="colUserName" HeaderText="User Name" CurrentFilterFunction="Contains">
                    <ItemStyle HorizontalAlign="Left" />
                </telerik:GridBoundColumn>
                <telerik:GridDateTimeColumn HeaderText="Clocked In" CurrentFilterFunction="GreaterThanOrEqualTo" DataField="ClockedInAt" DataType="System.DateTime" EditDataFormatString="dd-MMM-yyyy HH:mm" FilterControlAltText="Filter column column" FilterDateFormat="dd-MMM-yyyy HH:mm" PickerType="DateTimePicker" DataFormatString="{0:dd-MMM-yyyy HH:mm}" UniqueName="colClockInAt">
                </telerik:GridDateTimeColumn>
                <telerik:GridDateTimeColumn HeaderText="Clocked Out" CurrentFilterFunction="LessThanOrEqualTo" DataField="ClockedOutAt" DataType="System.DateTime" EditDataFormatString="dd-MMM-yyyy HH:mm" FilterControlAltText="Filter column1 column" FilterDateFormat="dd-MMM-yyyy HH:mm" PickerType="DateTimePicker" DataFormatString="{0:dd-MMM-yyyy HH:mm}" UniqueName="colClockOutAt">
                </telerik:GridDateTimeColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
</div>
<telerik:RadAjaxLoadingPanel ID="radLoadingPanel" runat="server" Skin="Metro"></telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxManager ID="radAjaxManager" runat="server" DefaultLoadingPanelID="radLoadingPanel">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="grdTimeSheets">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="grdTimeSheets" UpdatePanelCssClass="" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

with a combo box as follows:

<asp:DropDownList ID="ddlPayWeeks" runat="server" style="width: 200px;" OnSelectedIndexChanged="ddlPayWeeks_SelectedIndexChanged" AutoPostBack="True"></asp:DropDownList>

and in the code behind:

protected void ddlPayWeeks_SelectedIndexChanged(object sender, EventArgs e)
{
    if (ddlPayWeeks.SelectedIndex == 0)
        return;
 
    string selectedValue = ddlPayWeeks.SelectedValue;
    string startDate = selectedValue.Before("_");
    string finishDate = selectedValue.After("_");
 
    DateTime filterStartDate = DateTime.Parse(startDate);
    DateTime filterFinishDate = DateTime.Parse(finishDate);
 
    grdTimeSheets.MasterTableView.GetColumn("colClockInAt").CurrentFilterValue = string.Format("{0:dd-MMM-yyyy HH:mm}", filterStartDate);
    grdTimeSheets.MasterTableView.GetColumn("colClockInAt").CurrentFilterFunction = GridKnownFunction.GreaterThanOrEqualTo;
    grdTimeSheets.MasterTableView.GetColumn("colClockOutAt").CurrentFilterValue = string.Format("{0:dd-MMM-yyyy HH:mm}", filterFinishDate);
    grdTimeSheets.MasterTableView.GetColumn("colClockOutAt").CurrentFilterFunction = GridKnownFunction.LessThanOrEqualTo;
    grdTimeSheets.MasterTableView.Rebind();
}
 

So after the ddlPayWeeks_SelectedIndexChanged has fired I see the records as displayed in ss1.png - Note how the filter text has been filled in but the filter is not applied. If I then open the filter I see that the correct filter function is selected (ss2.png) but it is only when I click on the already selected GreaterThanOrEqualTo that I see the filter applied as per ss3.png.

 So I am guessing I need to do something additional in ddlPayWeeks_SelectedIndexChanged to cause the filter to occur?

Eyup
Telerik team
 answered on 03 Jun 2015
1 answer
59 views

Hi,

I've got two browser windows open, each having the same URL with a RadGrid showing different data.

When I try to edit rows on either grid, sometimes (not always) I get the attached error message.  I have no idea why.  Has anyone encountered this?

Thanks!

Brian
Top achievements
Rank 2
Iron
 answered on 02 Jun 2015
1 answer
107 views

I have been looking for a working example of a LINE CHART that uses a linqdata source.  They have an example of a bar chart, and I changed out the series type with a telerik:lineseries and it is just not working.  

 

I am sure I am just missing something very easy here...  Does anyone know of an example combining these two?

This should be stupid easy I would think.

 

 

 

Danail Vasilev
Telerik team
 answered on 02 Jun 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?