Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
155 views
Hi,

I have textboxes and my entire site is using RadFormControl. The problem is when I type a long string in a textbox, the width of the textbox elongate until it shows all the string. Thus affecting the width and position of the controls beside it. The width of my textboxes are set to 100% since my layout is fluid.

The problem only happens in IE8. I tried using Chrome and it does NOT elongate and works just fine. Thanks
Bozhidar
Telerik team
 answered on 09 Jun 2010
1 answer
214 views
Hi,

I'm having a problem with using GridBinaryImageColumn in  RadGrid. I want to customize my Insert/Edit form by using <EditFormSettings EditFormType="Template">and <FormTemplate>. But the problem is I can not access the GridBinaryImageColumn in the form template as other RadGrid elements. The GridBinaryImageColumnWhat auto generates the upload button.

Below is the code that I have:

<telerik:RadGrid runat="server" ID="RadGrid_Exercises" AllowPaging="True" AllowSorting="True"
            AutoGenerateColumns="False" ShowStatusBar="True" GridLines="None"
            OnNeedDataSource="RadGrid_Exercises_NeedDataSource" OnUpdateCommand="RadGrid_Exercises_UpdateCommand"
            OnItemCommand="RadGrid_Exercises_OnItemCommand"
            OnDeleteCommand="RadGrid_Exercises_DeleteCommand" OnInsertCommand="RadGrid_Exercises_InsertCommand">

<PagerStyle Mode="NumericPages" AlwaysVisible="true" />
            <MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="Id">
                <Columns>
              <telerik:GridEditCommandColumn ButtonType="ImageButton">
                        <HeaderStyle Width="3%" />
                    </telerik:GridEditCommandColumn>
               <telerik:GridBoundColumn DataField="Id" DataType="System.Int16" HeaderText="Id" ReadOnly="True"
                        SortExpression="Id" UniqueName="Id" Visible="false">
                    </telerik:GridBoundColumn>
                <telerik:GridBoundColumn  DataField="Name"  HeaderText="Name" UniqueName="Name" >
                    </telerik:GridBoundColumn>
                <telerik:GridBinaryImageColumn DataField="HowToImage1" HeaderText="HowToImage1" ResizeMode="Fit"
                            UniqueName="HowToImage1" ImageWidth="180px" ImageHeight="180px" />
              </Columns>
               <EditFormSettings EditFormType="Template">
                    <FormTemplate>
                     <asp:Label runat="server" ID="NameLBL" Text="Name" ></asp:Label>
                     <telerik:RadTextBox ID="NameRTB" runat="server" Text='<%# Bind("Name") %>' Skin="WebBlue" MaxLength="30">
                    </telerik:RadTextBox>


<<<<Here I need to define the layout of the Image upload>>>>>>


               </FormTemplate>
         </EditFormSettings>
   </MasterTableView>
</telerik:RadGrid>


Actually the code is very long and I'm using tables but I just made it short to show my problem.

Could you please tell my how I can use a BinaryImage in FormTemplate??

Thanks.




Rosen
Telerik team
 answered on 09 Jun 2010
1 answer
109 views
Hello,
Got a call today asking me to modify an app that is using a RadGrid->Form Template for data entry. The requested addition was that there be the addition of a dropdown for some existing items that when selected automatically populates the text boxes on the EditForm. This EditForm uses RadUpload as well - see below
<FormTemplate> 
                        <table id="Table1" cellspacing="1" cellpadding="1" width="350" style="height: 250px;" 
                            border="0"> 
                            <tr> 
                                <td> 
                                </td> 
                                <td> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td> 
                                    Resource Type: 
                                </td> 
                                <td> 
                                    <asp:DropDownList ID="optResTypes" runat="server" DataSourceID="ResTypeDS" DataTextField="name" 
                                        DataValueField="name" AppendDataBoundItems="true" SelectedValue='<%# Bind("resourcetype_text") %>'> 
                                        <asp:ListItem Selected="True" Text="Select" Value=""></asp:ListItem> 
                                    </asp:DropDownList> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td> 
                                    Title/Name: 
                                </td> 
                                <td> 
                                    <asp:TextBox ID="txtTitle" Text='<%# Bind("title") %>' runat="server"></asp:TextBox> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td> 
                                    Description/URL: 
                                </td> 
                                <td> 
                                    <asp:TextBox ID="txtDescription" Text='<%# Bind( "field1") %>' runat="server"> 
                                    </asp:TextBox> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td> 
                                    Additional Details: 
                                </td> 
                                <td> 
                                    <asp:TextBox ID="txtAddl" Text='<%# Bind( "field2") %>' runat="server"> 
                                    </asp:TextBox> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td> 
                                    File Attachment: 
                                </td> 
                                <td> 
                                    <telerik:RadUpload MaxFileSize="5000000" runat="server" ID="FileUpload1"  
                                        AllowedFileExtensions=".zip,.jpg,.pptx,.docx,.doc,.xls,.pdf,.gif,.ppt,.txt,.csv,.png,.xlsx" 
                                         ControlObjectsVisibility="None" OverwriteExistingFiles="true"> 
                                    </telerik:RadUpload> 
                                     
                                </td> 
                            </tr> 
                             
                            <%--<tr> 
                                <td> 
                                    File Name: 
                                </td> 
                                <td> 
                                    <asp:TextBox ID="FileName" runat="server" Text='<%#Bind ("filename") %>'></asp:TextBox> 
                                </td> 
                            </tr>--%> 
                            <table style="width: 100%"> 
                                <tr> 
                                    <td align="right" colspan="2"> 
                                        <asp:Button ID="UpdateButton" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' 
                                            runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'> 
                                        </asp:Button>&nbsp; 
                                        <asp:Button ID="Button2" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"> 
                                        </asp:Button> 
                                    </td> 
                                </tr> 
                            </table> 
                    </FormTemplate> 

Any ideas/examples would be great!

Thanks,
Kevin
Shinu
Top achievements
Rank 2
 answered on 09 Jun 2010
2 answers
94 views
Hello,

I am using RadEditor for MOSS v. 5.7.2.0 to create/edit wiki pages in MOSS 2007 SP2.
When using the LinkManager button from the toolbox to create a link to another wiki page, the control does not show .aspx files in a wiki library.
If I use MOSSLinkManager instead the .aspx wiki pages are visible, but I need to use the HyperlinkManager, because it has much richer functionality in it.
Is it intended to use only MOSSLinkManager in the RadEditor for MOSS or this problem could be fixed?
Dimitar
Top achievements
Rank 1
 answered on 09 Jun 2010
1 answer
119 views
i need to restrict the grid to a specific height. the idea being that verticle scroll bars will appear allowing me the scroll down to those rows that aren't initially displayed.

is this possible ?

if i set the height of the grid with the height property (i.e. Height="400px"), strange things happen. all the controls that were previously under the grid now appear in the middle of the grid, but the grid still takes up it's original height.

i can set the page size, but each row is of variable height, so the grid's height will vary according to what page it is displaying. i want the grid's height to remain static.

Thanks



Andy
Top achievements
Rank 1
 answered on 09 Jun 2010
1 answer
129 views
Hi All,

We are using the 2010 version of ASP.NET AJAX Controls. When the IE is set to IE-8 Compatibility mode, then the page is not displaying as expected.

We have a ASP.net panel and inside the panel we are calling the RadScheduler control. When the IE is set to IE-8 Compatibility mode the RadScheduler is getting hidden and also it is displaying over the panel.

Can you please help me to resolve this issue. I am pasting below a sample code. I am also attaching the screenshot.

Regards,
Govind

Default.aspx
-------------------------------------------------------------------------

<%

@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Scheduler._Default" %>

 

<!

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<%

@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

 

<%

--<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>--%>

 

<%

--<%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>

 

<%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>

<%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>--

 

%>

 

<%

--<%@ Register TagPrefix="sds" Namespace="Telerik.Web.SessionDS" %>--%>

 

<

 

html xmlns="http://www.w3.org/1999/xhtml">

 

<

 

head id="Head1" runat="server">

 

<%

--<qsf:HeadTag ID="Headtag1" runat="server" />--%>

 

 

<style type="text/css">

 

/* Fix for header wrapping issue in IE6/7 */* html #RadScheduler1 div.rsHeader h2

{

position: absolute;

}

* + html #RadScheduler1 div.rsHeader h2

{

position: absolute;

}

.Monday

{

color: blue !important;

}

.rsCategoryBlue

{

border-bottom-color: #9bb0cc;

border-top-color: #9bb0cc;

border-right-color: #9bb0cc;

border-left-color: #9bb0cc;

}

.rsCategoryRed

{

border-bottom-color: #cc9b9b;

border-top-color: #cc9b9b;

border-right-color: #cc9b9b;

border-left-color: #cc9b9b;

}

.rsCategoryGreen

{

border-bottom-color: #b0cc9b;

border-top-color: #b0cc9b;

border-right-color: #b0cc9b;

border-left-color: #b0cc9b;

}

.rsCategoryOrange

{

border-bottom-color: #cdb597;

border-top-color: #cdb597;

border-right-color: #cdb597;

border-left-color: #cdb597;

}

.rsCategoryPink

{

border-bottom-color: #d1bcdf;

border-top-color: #d1bcdf;

border-right-color: #d1bcdf;

border-left-color: #d1bcdf;

}

.rsCategoryYellow

{

border-bottom-color: #dfdba7;

border-top-color: #dfdba7;

border-right-color: #dfdba7;

border-left-color: #dfdba7;

}

.rsCategoryViolet

{

border-bottom-color: #742062;

border-top-color: #742062;

border-right-color: #742062;

border-left-color: #742062;

}

.rsCategoryDarkRed

{

border-bottom-color: #370505;

border-top-color: #370505;

border-right-color: #370505;

border-left-color: #370505;

}

.rsCategoryDarkGreen

{

border-bottom-color: #053705;

border-top-color: #053705;

border-right-color: #053705;

border-left-color: #053705;

}

.rsCategoryDarkBlue

{

border-bottom-color: #304364;

border-top-color: #304364;

border-right-color: #304364;

border-left-color: #304364;

}

 

</style>

 

 

<script type="text/javascript">

 

 

function OnClientNavigationCommand(sender, eventArgs) {

 

 

// 7 = SwitchToDayView

 

 

if (eventArgs.get_command() == 7)

 

eventArgs.set_cancel(

true);

 

}

 

/* Firefox resize scrollable content */

 

 

function hideScrollableArea(sender, eventArgs) {

 

 

if ($telerik.isFirefox)

 

$telerik.$(

'.rsContentScrollArea').css('overflow', 'hidden');

 

}

 

function showScrollableArea(sender, eventArgs) {

 

 

if ($telerik.isFirefox)

 

$telerik.$(

'.rsContentScrollArea').css('overflow', 'auto');

 

}

 

 

</script>

 

</

 

head>

 

<

 

body class="BODY">

 

 

<form id="Form1" method="post" runat="server">

 

 

<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="RadScheduler1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadSplitter1" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

<telerik:AjaxSetting AjaxControlID="RadScheduler2">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadSplitter1" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager>

 

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" InitialDelayTime="200" />

 

 

<div class="exampleContainer" width="500px" style="vertical-align: top">

 

<%

-- <telerik:RadSplitter runat="server" ID="RadSplitter1" Width="740px">

 

 

<telerik:RadPane runat="server" ID="SchedulerPane" MinWidth="350" Width="500px" Scrolling="None">

 

 

</telerik:RadPane>

</telerik:RadSplitter>--

 

%>

 

 

<asp:Panel ID="Panel1" runat="server" ScrollBars="Horizontal" Width="999px" BorderStyle="Groove"

 

 

BorderWidth="2px">

 

 

<table style="border-color:red; border-width:thick; height:100%" >

 

 

<tr valign="top">

 

 

<td valign="top" style="height:100%; border-width:thick; background-color:Green">

 

 

<telerik:RadScheduler runat="server" ID="RadScheduler2" SelectedDate="2010-01-01"

 

 

Width="500px" SelectedView="MonthView" ShowHeader="true" ShowViewTabs="false"

 

 

ShowNavigationPane="false" ShowFooter="false" AllowEdit="false" AllowInsert="false"

 

 

AllowDelete="false" OnClientNavigationCommand="OnClientNavigationCommand"

 

 

OnAppointmentCreated="RadScheduler_OnAppointmentCreated"

 

 

OverflowBehavior="Expand" MonthView-AdaptiveRowHeight="True"

 

 

Height="100px">

 

 

<MonthView VisibleAppointmentsPerDay="20" AdaptiveRowHeight="true" />

 

 

</telerik:RadScheduler>

 

 

</td>

 

 

<td style="height:100%; border-width:thick; background-color:Green">

 

 

<telerik:RadScheduler runat="server" ID="RadScheduler1" SelectedDate="2010-02-01"

 

 

Width="500px" SelectedView="MonthView" ShowHeader="true" ShowViewTabs="false"

 

 

ShowNavigationPane="false" ShowFooter="false" AllowEdit="false" AllowInsert="false"

 

 

AllowDelete="false" OnClientNavigationCommand="OnClientNavigationCommand"

 

 

OnAppointmentCreated="RadScheduler_OnAppointmentCreated"

 

 

OverflowBehavior="Expand" MonthView-AdaptiveRowHeight="true"

 

 

Height="100%" style="top: 0px; left: 0px">

 

 

<MonthView VisibleAppointmentsPerDay="20" AdaptiveRowHeight="true" />

 

 

</telerik:RadScheduler>

 

 

</td>

 

 

<td >

 

 

<telerik:RadScheduler runat="server" ID="RadScheduler3" SelectedDate="2010-03-01"

 

 

Width="500px" SelectedView="MonthView" ShowHeader="true" ShowViewTabs="false"

 

 

ShowNavigationPane="false" ShowFooter="false" AllowEdit="false" AllowInsert="false"

 

 

AllowDelete="false" OnClientNavigationCommand="OnClientNavigationCommand"

 

 

OnAppointmentCreated="RadScheduler_OnAppointmentCreated"

 

 

OverflowBehavior="Expand" Height="100%">

 

 

<MonthView VisibleAppointmentsPerDay="20" AdaptiveRowHeight="true" />

 

 

</telerik:RadScheduler>

 

 

</td>

 

 

<td style="height:100%; border-width:thick; background-color:Green">

 

 

<telerik:RadScheduler runat="server" ID="RadScheduler4" SelectedDate="2010-04-01"

 

 

Width="500px" SelectedView="MonthView" ShowHeader="true" ShowViewTabs="false"

 

 

ShowNavigationPane="false" ShowFooter="false" AllowEdit="false" AllowInsert="false"

 

 

AllowDelete="false" OnClientNavigationCommand="OnClientNavigationCommand"

 

 

OnAppointmentCreated="RadScheduler_OnAppointmentCreated"

 

 

OverflowBehavior="Expand" Height="100px">

 

 

<MonthView VisibleAppointmentsPerDay="20" AdaptiveRowHeight="true" />

 

 

</telerik:RadScheduler>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</div>

 

 

</asp:Panel>

 

 

</form>

 

</

 

body>

 

</

 

html>

 


CS file
--------------------------------------------------------

namespace

 

Scheduler

 

{

 

public partial class _Default : System.Web.UI.Page

 

{

 

private const string ProviderSessionKey = "Telerik.Web.Examples.Scheduler.MultipleInstances.DefaultCS";

 

 

// You can safely ignore this method.

 

 

// Its purpose is to limit the changes to the underlying data only to the active user session.

 

 

protected void Page_Init(object sender, EventArgs e)

 

{

 

XmlSchedulerProvider provider;

 

 

if ((Session[ProviderSessionKey] == null) || (!IsPostBack))

 

{

provider =

new XmlSchedulerProvider(

 

Server.MapPath(

"~/App_Data/MultipleInstances.xml"), false);

 

Session[ProviderSessionKey] = provider;

}

 

else

 

{

provider = (

XmlSchedulerProvider)Session[ProviderSessionKey];

 

}

RadScheduler2.Provider = provider;

RadScheduler1.Provider = provider;

RadScheduler3.Provider = provider;

RadScheduler4.Provider = provider;

 

//RadScheduler2.Height = RadScheduler1.Height;

 

 

//RadScheduler3.Height = RadScheduler1.Height;

 

 

//RadScheduler4.Height = RadScheduler1.Height;

 

 

//RadScheduler4.Height = Unit.Pixel(150);

 

}

 

private void Page_Load(object sender, EventArgs e)

 

{

 

//RadScheduler2.Height = RadScheduler1.Height;

 

 

//RadScheduler3.Height = RadScheduler1.Height;

 

 

//RadScheduler4.Height = RadScheduler1.Height;

 

 

//RadScheduler4.Height = Unit.Pixel(150);

 

}

 

protected void RadScheduler_OnAppointmentCreated(object sender, AppointmentCreatedEventArgs e)

 

{

 

switch (e.Appointment.Attributes["type"])

 

{

 

case "1":

 

e.Appointment.CssClass =

"rsCategoryBlue";

 

 

break;

 

 

case "2":

 

e.Appointment.CssClass =

"rsCategoryViolet";

 

 

break;

 

 

case "3":

 

e.Appointment.CssClass =

"rsCategoryRed";

 

 

break;

 

 

case "4":

 

e.Appointment.CssClass =

"rsCategoryOrange";

 

 

break;

 

 

case "5":

 

e.Appointment.CssClass =

"rsCategoryGreen";

 

 

break;

 

 

case "6":

 

e.Appointment.CssClass =

"rsCategoryPink";

 

 

break;

 

 

case "7":

 

e.Appointment.CssClass =

"rsCategoryYellow";

 

 

break;

 

 

case "8":

 

e.Appointment.CssClass =

"rsCategoryDarkRed";

 

 

break;

 

 

case "9":

 

e.Appointment.CssClass =

"rsCategoryDarkGreen";

 

 

break;

 

 

case "10":

 

e.Appointment.CssClass =

"rsCategoryDarkBlue";

 

 

break;

 

 

default:

 

e.Appointment.CssClass =

"rsCategoryBlue";

 

 

break;

 

}

}

}

}

Peter
Telerik team
 answered on 09 Jun 2010
0 answers
93 views
Halo, I use Radboxlist in 2 versions, one whit Ajax and the oder whitout Ajax.
The Ajax version works well, but now I want to use the Listbox whit Autopostback.
The problem ar that on mouse over the Item ar not selected and also if I check a item the value ist not saved after postback.
I kann not find what its wrong.
I'm lucky for any sugestions.
Danks.

Darius Restea
Top achievements
Rank 1
 asked on 09 Jun 2010
1 answer
224 views
Hi everyone

I have two issue with RadRatting, I hope someone could help me.

1- I don't know have could get value of RadRatting for validation on "OnClientRating" event, sender.get_value() just give me Old-Value, Not Current-value !!!!!!

2- I don't know have rat 0, when ratted some value, for Example when I Rate 5 star, I can't change value to 0 star (I prefer do this, whit user click, Not with programming).

3- It is possible that force end-users to just ratting between two values (for examples ratting between 3-8) ?!!!!!!!!

Best Regards,
M.Hajinezhad.
Tsvetie
Telerik team
 answered on 09 Jun 2010
4 answers
102 views

In Opera (9.63)  the user can select (and copy) the nodes text. In Firefox 3.0.8 it seems that you cant select the text at all. And in IE 7.0 the user must (start) select from the left outside the node. We are using the RadTreeView in a forum and the users need to be able to copy text. Any solutions?

Regards

Jan

Sargis
Top achievements
Rank 1
 answered on 09 Jun 2010
3 answers
188 views
Dear Teleriks

I have an issue on filtering(combobox) and sorting on radgrid, even page is not too slow on first time, Please see my code and advise

here is my grid

 

<telerik:RadGrid ID="RadGrid1" Width="100%"

 

 

AllowMultiRowSelection="true" AllowFilteringByColumn="true"

 

 

AutoGenerateColumns="false" CellSpacing="0"

 

 

ClientSettings-Scrolling-ScrollHeight="40%"

 

 

ClientSettings-Scrolling-AllowScroll="true" EnableLinqExpressions="false"

 

 

ClientSettings-Scrolling-UseStaticHeaders="true"

 

 

AllowSorting="True" runat="server">

 

 

<GroupingSettings CaseSensitive="false" />

 

 

 

<MasterTableView TableLayout="Fixed" DataKeyNames="KEYID" ClientDataKeyNames="KEYID" >

 

 

 

<Columns>

 

 

<telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderStyle-Width="3%" ItemStyle-Width="3%" />

 

 

<telerik:GridNumericColumn Aggregate="Count" DataField="KEYID" HeaderText="KEYID" SortExpression="KEYID"

 

 

UniqueName="KEYID" />

 

 

 

<telerik:GridBoundColumn HeaderText="Employees" DataField="Name" UniqueName="Name" ShowFilterIcon="false"

 

 

HeaderStyle-Width="13%" ItemStyle-Width="13%" SortExpression="Name" AllowFiltering="true"

 

 

AutoPostBackOnFilter="true" FilterControlWidth="80" />

 

 

 

<telerik:GridBoundColumn HeaderText="Pay Period" DataField="Description" UniqueName="Description" ShowFilterIcon="false"

 

 

SortExpression="Description" HeaderStyle-Width="13%" ItemStyle-Width="13%">

 

 

 

<FilterTemplate>

 

 

<telerik:RadComboBox ID="RadComboBoxPP" CausesValidation="false" DataSourceID="SqlDataSourcePP" DataTextField="Code" Width="100"

 

 

DataValueField="Code" Height="100px" AppendDataBoundItems="true" OnClientSelectedIndexChanged="SelectedIndexChanged"

 

 

SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("Description").CurrentFilterValue %>'

 

 

runat="server">

 

 

<Items>

 

 

<telerik:RadComboBoxItem Text="All" />

 

 

</Items>

 

 

</telerik:RadComboBox>

 

 

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">

 

 

<script type="text/javascript">

 

 

function SelectedIndexChanged(sender,args) {

 

 

var tableView=$find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");

 

sender.value= args.get_item().get_value();

tableView.filter(

"Description",args.get_item().get_value(),"EqualTo");

 

}

 

</script>

 

 

</telerik:RadScriptBlock>

 

 

</FilterTemplate>

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn HeaderText="Department" HeaderStyle-Width="18%" ItemStyle-Width="18%" DataField="Department" UniqueName="Department" ShowFilterIcon="false"

 

 

SortExpression="Department" >

 

 

<FilterTemplate>

 

 

<telerik:RadComboBox ID="RadComboBoxDep" CausesValidation="false" DataSourceID="SqlDataSourceDepartment" DataTextField="Department" width="150"

 

 

DataValueField="Department" Height="100px" AppendDataBoundItems="true" OnClientSelectedIndexChanged="SelectedIndexChanged2"

 

 

SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("Department").CurrentFilterValue %>'

 

 

runat="server">

 

 

<Items>

 

 

<telerik:RadComboBoxItem Text="All" />

 

 

</Items>

 

 

</telerik:RadComboBox>

 

 

<telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">

 

 

<script type="text/javascript">

 

 

function SelectedIndexChanged2(sender,args) {

 

 

var tableView=$find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");

 

sender.value= args.get_item().get_value();

tableView.filter(

"Department",args.get_item().get_value(),"EqualTo");

 

}

 

</script>

 

 

</telerik:RadScriptBlock>

 

 

</FilterTemplate>

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridDateTimeColumn ReadOnly="true" DataField="Paydate" HeaderText="Pay Date" DataFormatString="{0:d}" HeaderStyle-Width="13%" ItemStyle-Width="13%" DataType="System.DateTime" UniqueName="PayDate" AllowFiltering="true" SortExpression="PayDate" FilterControlWidth="90"> </telerik:GridDateTimeColumn>

 

 

 

 

 

<telerik:GridBoundColumn AllowFiltering="false" HeaderText="Start Date" HeaderStyle-Width="10%" ItemStyle-Width="10%" DataFormatString="{0:d}" DataField="PayDateFrom" UniqueName="PayDateFrom" DataType="System.DateTime" ShowFilterIcon="false"

 

 

SortExpression="PayDateFrom" />

 

 

 

<telerik:GridBoundColumn HeaderText="End Date" DataField="Paydateto" HeaderStyle-Width="10%" ItemStyle-Width="10%" DataFormatString="{0:d}" UniqueName="Paydateto" DataType="System.DateTime" ShowFilterIcon="false" AllowFiltering="false"

 

 

SortExpression="Paydateto" />

 

 

 

<telerik:GridBoundColumn HeaderText="Hire/Rehire" HeaderStyle-Width="10%" ItemStyle-Width="10%" DataField="EMPDOH" UniqueName="EMPDOH" DataFormatString="{0:d}" DataType="System.DateTime" ShowFilterIcon="false" AllowFiltering="false"

 

 

SortExpression="EMPDOH" />

 

 

 

<telerik:GridBoundColumn HeaderStyle-Width="2%" ItemStyle-Width="1%" DataField="hdismass" UniqueName="hdismass" HeaderText="hdismass" AllowFiltering="false"

 

 

/>

 

 

 

<telerik:GridBoundColumn HeaderStyle-Width="2%" HeaderText="hds" ItemStyle-Width="1%" DataField="hds" UniqueName="hds" AllowFiltering="false"

 

 

/>

 

 

 

</Columns>

 

 

</MasterTableView>

 

 

<ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true">

 

 

<Selecting AllowRowSelect="true" />

 

 

<Resizing EnableRealTimeResize="True" ResizeGridOnColumnResize="false" AllowColumnResize="true">

 

 

</Resizing>

 

 

<ClientEvents OnRowSelecting="rowselecting" />

 

 

</ClientSettings>

 

 

</telerik:RadGrid>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

 

</div>

 

 

<asp:SqlDataSource runat="server" ID="SqlDataSourceGrid"></asp:SqlDataSource>

 

 

<asp:SqlDataSource ID="SqlDataSourcePP" runat="server"></asp:SqlDataSource>

 

 

<asp:SqlDataSource ID="SqlDataSourceUsers" runat="server"></asp:SqlDataSource>

 

 

<asp:SqlDataSource ID="SqlDataSourceDepartment" runat="server"></asp:SqlDataSource>

and here is the codebehind function

 

Protected

 

Sub BindGrid2()

 

 

If Not IsPostBack Then

 

 

 

 

SqlDataSourceUsers.ConnectionString = ConfigurationManager.AppSettings.Item(

"ConnectString")

 

SqlDataSourceUsers.SelectCommand =

"select PrimaryKey, UserID From Security_Users Where PrimaryKey <> 1"

 

 

 

 

SqlDataSourceUsers.SelectCommandType = SqlDataSourceCommandType.Text

 

End If

 

 

 

 

SqlDataSourcePP.ConnectionString = ConfigurationManager.AppSettings.Item(

"ConnectString")

 

SqlDataSourcePP.SelectCommand =

"Select distinct Code From CT_Payperiods"

 

 

 

 

SqlDataSourcePP.SelectCommandType = SqlDataSourceCommandType.Text

SqlDataSourceDepartment.ConnectionString = ConfigurationManager.AppSettings.Item(

"ConnectString")

 

SqlDataSourceDepartment.SelectCommand =

"select DISTINCT Description as Department from CT_Departments WHERE GROUPID >= 0 "

 

 

 

 

SqlDataSourceDepartment.SelectCommandType = SqlDataSourceCommandType.Text

 

If isSelIndex = False Then BindFilters()

 

 

SqlDataSourceGrid.ConnectionString = ConfigurationManager.AppSettings.Item(

"ConnectString")

 

SqlDataSourceGrid.SelectCommand =

"Pr_GetPayEmployee"

 

 

 

 

SqlDataSourceGrid.SelectCommandType = SqlDataSourceCommandType.StoredProcedure

SqlDataSourceGrid.SelectParameters.Clear()

 

If radioGD.Items(1).Selected = True Then

 

 

 

 

SqlDataSourceGrid.SelectParameters.Add(

"mGrpKey", cmbGroup.Items(cmbGroup.SelectedIndex).Value)

 

 

Else

 

 

 

 

SqlDataSourceGrid.SelectParameters.Add(

"mGrpKey", -1)

 

 

End If

 

 

 

 

SqlDataSourceGrid.SelectParameters.Add(

"mDeptKey", -1)

 

SqlDataSourceGrid.SelectParameters.Add(

"mEmpKey ", -1)

 

 

'SqlDataSourceGrid.SelectParameters.Add("PayDate", "")

 

 

 

 

SqlDataSourceGrid.SelectParameters.Add(

"bRequired", 0)

 

SqlDataSourceGrid.SelectParameters.Add(

"PayPeriod", -1)

 

SqlDataSourceGrid.SelectParameters.Add(

"PRKEY", -1)

 

RadGrid1.DataSourceID =

"SqlDataSourceGrid"

 

 

 

 

 

 

 

End Sub

 

Pavlina
Telerik team
 answered on 09 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?