Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
44 views
Hi,

I was trying to customize a filter so that it'll filter the grid according to a predefined string. I was looking for a way to work around the issue of filtering a string that contains special characters.

basically, if the user select a filter with a name of "greater"...then it'll return all items that has the value ">130hp"...otherwise, if a user select a filter with a name of "less"....then it'll return all items that has the value "<130hp"

the following contains my initial code...copied and modified from the telerik documentation. Any assistance is welcome.


protected

 

 

void GridChevronPortEQ_ItemCommand(object sender, GridCommandEventArgs e)

 

{

 

 

if (e.CommandName == RadGrid.FilterCommandName)

 

{

 

 

Pair filterPair = (Pair)e.CommandArgument;

 

 

 

if (filterPair.First.ToString() == "greater")

 

{

 

 

string colName = filterPair.Second.ToString();

 

 

 

TextBox tbPattern = (e.Item as GridFilteringItem)[colName].Controls[0] as TextBox;

 

 

 

string[] values = tbPattern.Text.Split(' ');

 

 

 

if (values.Length == 2)

 

{

e.Canceled =

 

true;

 

 

 

string newFilter = "(([" + filterPair.Second + "] >='" + values[0] + "') AND ([" + filterPair.Second + "] <='" + values[1] + "'))";

 

 

 

if (GridChevronPortEQ.MasterTableView.FilterExpression == "")

 

{

GridChevronPortEQ.MasterTableView.FilterExpression = newFilter;

}

 

 

else

 

{

GridChevronPortEQ.MasterTableView.FilterExpression =

 

"((" + GridChevronPortEQ.MasterTableView.FilterExpression + ") AND (" + newFilter + "))";

 

}

GridChevronPortEQ.Rebind();

}

}

}

}

Antonio Stoilkov
Telerik team
 answered on 23 May 2012
1 answer
114 views
Hi Telerik Team,

My environment is MOSS 2007, a published internet site (anonymous access enabled) with output cache enabled. Details:
- A Rad Catpcha control is used on a Page Layout. A page instance has been created (e.g. page1.aspx).
- A RadScriptManager is declared on the page layout.
- Some of ASP.NET controls (e.g. textbox) and some built-in ASP.NET validators are also used (e.g. RequiredFieldValidator).
- Web resource handler is also registered in web.config.

My problem is that all the asp.net validators are not got validated at client side on submission. After investigated, I guess the problem is because the rendered page (page1.aspx as the example above) could not reach the ScriptResource.axd but I don't know why and how to get client script validated on those server controls. If I remove the RadScriptManager and RadCaptcha from the page layout, everything works as normal (i.e. client side validation takes place).

Could you please help me on this?

P/S: everything works well on my edit site (the internal version of that published internet site).

Thanks,
Them
Slav
Telerik team
 answered on 23 May 2012
5 answers
223 views
Using FileExplorer with the EnableAsyncUpload="true" how do I see when the FileUploaded Event on the server side is fired?
Dobromir
Telerik team
 answered on 23 May 2012
1 answer
68 views
Hello,

I have a RadGrid with "EditFormType = GridEditFormType.Template" with "InsertItemDisplay = GridInsertItemDisplay.Top". The list contains two pages. When I'm on page 1 and click the insert command, the grid jumps to page 2 and opens the editform. 
Why does the Grid jump to page 2?
Jayesh Goyani
Top achievements
Rank 2
 answered on 23 May 2012
1 answer
125 views
I have grid in which i want have my own styling? i set <SelectedItemStyle CssClass="gridSelectedItemStyle"/>(
in css
.gridSelectedItemStyle 
{
    background: #A7CDF0 !important;
}
)
and SortingSettings-SortedBackColor="Green"
When i sort by any column, all rows in this column have Green Color, and when i click on any row, this row start to be A7CDF0 color, but sorted row still "Green", i want that all cells in  selected row will be "A7CDF0" background. Screen in attachment.

Andrey
Princy
Top achievements
Rank 2
 answered on 23 May 2012
0 answers
94 views
Hello,

I have a problem with RadGrid, where MyRadGrid.MasterTableView.FilterExpression works only with one filter and I would like to use multiple filters together. I am using standard filters and custom filtering columns.

From what I have read on these forums and in the documentation the FilterExpression needs to be set manually for each column.

It is not very clear to me how I should do that for the standard filters. I am using a NeedDataSource event to bind the grid.

Software versions are as follows:
Windows 7
ASP.NET 4
Visual Studio 2010 Premium
Telerik RadControls for ASP.NET AJAX v.2010.2.826.40

Any help is appreciated.
Ivan
Top achievements
Rank 1
 asked on 23 May 2012
2 answers
337 views
Hi,

I have applied custom CSS for the radgrid. With the default CSS, context menus and expand buttons were looking fine. But with new color scheme (basically with black background), I am having trouble in displaying Header Context menus and expand button.
1. For Header Context menus, I am not able to provide background color for Columns submenu and Filter submenu. I have attached CSS changes I made so that background of main context menu and text for all menus is changed. But submenus for Columns and Fileter has transperant background and very difficult for user to use them.
2. For expand button, as my grid background color is black, I am not able to see Expand, collapse default icons. 

My CSS is as follows -
.rgRow td, .rgAltRow td, .rgHeader td, .rgFilterRow td

 {
border-left: solid 0px black;

border-bottom: solid 0px black;

 }
RadGrid .rgFilterBox

 {
background-color: Gray;

border-width: 1px;

border-style: solid;
margin: 0;

padding: 2px 1px 3px;
font-size: 12px;

vertical-align: middle;

}

 

.RadGrid_Black th.rgHeader

 {
background-image: none;

}

 

.GridContextMenu

{
background-color: #3e4147;
color: #00b1dc;
}
.GridContextMenu .rgHCMCols .rmLeftImage .rmRightImage

 {

background-color: White;

color: Yellow;

}

 

 

 

.RadGrid_Office2010SilverCustom .rgMasterTable td.rgExpandCol

 

{

 

background: transparent;
border-color: #fff;

 }
.RadGrid_Office2010SilverCustom .rgMasterTable .rgAltRow .rgExpandCol

 {
background: #f2f2f2 ;

color:Lime;
background-image

}

 

 

.RadGrid_Office2010SilverCustom .rgMasterTable td.rgExpandCol

 

 

background: transparent;

border-color: #fff;
}

 

 

 

.RadGrid_Office2010SilverCustom .rgMasterTable .rgAltRow .rgExpandCol

 

{

 

background: #f2f2f2 ;
color:Lime;

 }

Any help is apreciated.

Thanks

Mandy
Top achievements
Rank 1
 answered on 23 May 2012
2 answers
99 views
I have the following ASPX page:

<script type="text/javascript">
    function SectorChanged(sender, eventArgs) {
        var selectedItem = eventArgs.get_item();
        var selectedItemText = selectedItem.get_element().childNodes[1].innerText;
 
        var textInput = $get('<%= companyGicsFormView.FindControl("txtSectorText").ClientID %>');
        textInput .value = selectedItemText ;
        textInput .text = selectedItemText ;
    }
 
    function OnClientDropDownOpeningHandler(sender, eventArgs) {
        sender.requestItems("", false);
    }
</script>
 
<asp:FormView runat="server" ID="formView" DefaultMode="Edit">
  <EditItemTemplate>
    <telerik:RadComboBox runat="server" ID="cboTest" DataSourceID="customDs"
                                             DataTextField="Sector" DataValueField="Sector" SelectedValue='<%# Bind("Sector") %>'
                                             OnClientSelectedIndexChanged="SectorChanged"
                                             HighlightTemplatedItems="true" AllowCustomText="false" EnableLoadOnDemand="false"
                                             OnClientDropDownOpening="OnClientDropDownOpeningHandler">
                        <ItemTemplate>
                                <%# DataBinder.Eval(Container.DataItem, "Sector") %>
                                <span style="display:none;"><%# DataBinder.Eval(Container.DataItem, "SectorText")%></span>
                        </ItemTemplate>
    </telerik:RadComboBox>
    <telerik:RadTextBox ID="txtSectorText" runat="server" Text='<%# Bind("SectorText") %>' MaxLength="255" ReadOnly="False" Enabled="False" />
  </EditItemTemplate>
</asp:FormView>

The cboTest Combo Box is being populated correctly. The txtSectorText is also updated when I select something from the combobox. However: Neither the combo box value nor the textbox value are saved to the datasource.

I'm thinking this has something to do with databinding, but I'm stuck on how to correctly databind these two controls.

(PS: What I'm basically trying to do is to set the textbox value based upon a selection from the combo box)
Dennis
Top achievements
Rank 1
 answered on 23 May 2012
3 answers
127 views
Hi.
I'm using RadGrid with two pre-defined columns, one of those column is a GridTemplateColumn with RadButton used as a checkbox.
When i enable scrolling (to avoid a need to scroll down the whole page) the checkboxes are displayed just the same as for grid without scrolling. Screenshot is attached:

Pavlina
Telerik team
 answered on 23 May 2012
9 answers
270 views
Hi,

I've 2 radnumerictextbox ( A & B )  in a row in grid.
Each one have dictinct textchanged event functions (FunctionA & FunctionB)

When i modify B, FunctionB is fired. FunctionB modify the value of A.
If i modify again B, functionA is fired instead of FunctionB.

Is there a way to cancel this event after modification in code behind ?

Thanks

OPL
Martin
Telerik team
 answered on 23 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?