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

  I seen demo of dock  (http://demos.telerik.com/aspnet-ajax/dock/examples/default/defaultcs.aspx) & i want control which is used in this demo.  they created user controls of news ,& blogs. i want same control which will be collapse & expand. which control i should use for this?

any help is appreciated.......
it's urgent............



  
 
Georgi Tunev
Telerik team
 answered on 06 Jul 2010
1 answer
216 views
Hi,

I have used RadGrid control without having Column tag as follows:
 
<telerik:RadGrid ID="radgridAuditReports" EnableEmbeddedSkins="false" runat="server" 
                Skin="WebBlue" Width="12000px"  PageSize="10" AllowSorting="true" AllowPaging="true"    
                ShowGroupPanel="false" AllowMultiRowEdit="false" AutoGenerateColumns="true" GridLines="None"   
                OnNeedDataSource="radgridAuditReports_NeedDataSource" AllowAutomaticInserts="false">  
                <SortingSettings EnableSkinSortStyles="false" /> 
                <HeaderStyle Width="125px" /> 
                <PagerStyle CssClass="Pager" Mode="NumericPages" Position="Bottom" HorizontalAlign="Left" 
                    ShowPagerText="false"></PagerStyle> 
                <CommandItemStyle HorizontalAlign="Right" /> 
                <ItemStyle HorizontalAlign="Left" Height="25px" /> 
                <AlternatingItemStyle HorizontalAlign="Left" Height="25px" /> 
                <HeaderStyle HorizontalAlign="Left" /> 
                <MasterTableView Width="100%" TableLayout="Fixed" CommandItemSettings-ShowRefreshButton="false" 
                    ItemStyle-HorizontalAlign="Left" GroupHeaderItemStyle-HorizontalAlign="Left" 
                    AllowSorting="true">  
                </MasterTableView> 
               
            </telerik:RadGrid> 
I have used a data table to bind the grid in Code behind (radgridAuditReports_NeedDataSource). When i clicked on the header text for sorting, it does not display the SortAsc/SortDesc image. Please help me with the solution to set the Sort image.
 
Thanks,
Abirami R.
Princy
Top achievements
Rank 2
 answered on 06 Jul 2010
2 answers
452 views
Hi,

In my current project, I have to write a web page containing a RadGrid with Persisted Sorting.

I have implement the web page similar to as follows RadGrid with Persisted Sorting

The RadGrid's SortExpressions are persisted in the Settings which are saved (i.e. serialized) on Page_UnLoad and loaded (i.e. deserialized) on Page_Load.

I created the class SortExpressions instead of using Telerik's GridSortExpression because GridSortExpression is not marked as Serializable.

The web page works as expected. However, can you please review my code if I have implemented it correctly?

The code is given as follows:

ASPX
<form id="form1" runat="server"> 
<div> 
    <telerik:RadScriptManager ID="radScriptManager" runat="server" /> 
    <telerik:RadGrid ID="radGrid" AutoGenerateColumns="false" AllowSorting="true" OnNeedDataSource="radGrid_NeedDataSource" runat="server"> 
        <ClientSettings> 
            <Scrolling UseStaticHeaders="true" /> 
        </ClientSettings>  
        <MasterTableView AllowMultiColumnSorting="true" TableLayout="Fixed"> 
            <Columns> 
                <telerik:GridBoundColumn DataField="Name" DataType="System.String" HeaderText="Name" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" SortExpression="Name" AllowSorting="true" UniqueName="Name" /> 
                <telerik:GridBoundColumn DataField="Founder" DataType="System.String" HeaderText="Founder" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" SortExpression="Founder" AllowSorting="true" UniqueName="Founder" /> 
            </Columns> 
        </MasterTableView> 
    </telerik:RadGrid>   
</div> 
</form> 

C#
public partial class RadGridWithSorting : Page 
{ 
    private const string SettingsFilename = "Settings.bin"; 
    private Settings _settings = null; 
    private List<Company> _companies = null; 
 
    protected Settings Settings 
    { 
        get 
        { 
            if (this._settings == null) 
            { 
                this._settings = new Settings(); 
            } 
            return this._settings; 
        } 
        set 
        { 
            this._settings = value; 
        } 
    } 
 
    protected void Page_Load(object sender, EventArgs e) 
    { 
        LoadSettings(); 
        LoadSortExpressions(); 
 
        if (!IsPostBack) 
        { 
            this._companies = Company.Load(); 
            Session["COMPANIES"] = this._companies; 
        } 
        else 
        { 
            this._companies = (List<Company>)Session["COMPANIES"]; 
        } 
    } 
 
    protected void Page_UnLoad(object sender, EventArgs e) 
    { 
        SaveSortExpressions(); 
        SaveSettings(); 
    } 
 
    protected void radGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e) 
    { 
        this.radGrid.DataSource = this._companies; 
    } 
 
    private void LoadSettings() 
    { 
        Settings = Helper.Load(SettingsFilename); 
    } 
 
    private void LoadSortExpressions() 
    { 
        this.radGrid.MasterTableView.SortExpressions.Clear(); 
        foreach (SortExpression sortExpression in Settings.SortExpressions) 
        { 
            GridSortExpression gridSortExpression = new GridSortExpression(); 
            gridSortExpression.FieldName = sortExpression.FieldName; 
            gridSortExpression.SortOrder = sortExpression.SortOrder; 
            this.radGrid.MasterTableView.SortExpressions.AddSortExpression(gridSortExpression); 
        } 
    } 
 
    private void SaveSettings() 
    { 
        Helper.Save(Settings, SettingsFilename); 
    } 
 
    private void SaveSortExpressions() 
    { 
        Settings.SortExpressions.Clear(); 
        foreach (GridSortExpression sortExpression in this.radGrid.MasterTableView.SortExpressions) 
        { 
            Settings.SortExpressions.Add(new SortExpression(sortExpression.FieldName, sortExpression.SortOrder)); 
        } 
    } 
} 
 
[Serializable] 
public class Settings 
{ 
    public List<SortExpression> SortExpressions { get; set; } 
 
    public Settings() 
    { 
        SortExpressions = new List<SortExpression> {}; 
    } 
    public Settings(List<SortExpression> sortExpressions) 
    { 
        SortExpressions = sortExpressions; 
    } 
} 
 
[Serializable] 
public class SortExpression 
{ 
    public string FieldName { get; set; } 
    public GridSortOrder SortOrder { get; set; } 
 
    public SortExpression() 
    { 
        FieldName = null; 
        SortOrder = GridSortOrder.None; 
    } 
    public SortExpression(string fieldName, GridSortOrder sortOrder) 
    { 
        FieldName = fieldName; 
        SortOrder = sortOrder; 
    } 
} 

Thanks,
Herman
Herman Gouw
Top achievements
Rank 2
 answered on 06 Jul 2010
1 answer
144 views
I have an object model defined using Open Access. The object has a collection of child objects.

I want to:
  1. display my objects in a grid
  2. display the objects in the child collection in a details grid.
  3. use the fact that OA is prefetching the child data for me to populate the child grids.

Items 1 and 2 are straightforward, I've created the grid and created a child grid. It's 3 that's causing me the problem.

All of the examples I've seen to use 2 separate fetches, usually via SQL to populate the grids; the first for the master table the 2nd for the child grid.

What I hoped to do was get the DetailTableDataBind event to fire for each row in the master table view that was bound, access the parent item and set the data source of the detail table to the collection of child objects.

Sadly this won't work (prolly 'cos I'm doing it wrong).

I've set the detail table up using this ...
<telerik:GridTableView Name="Locations" HierarchyLoadMode="ServerBind"> 

And from what I read in the docs, I expected this to cause the DetailTableDataBind to fire after the ItemDataBound event for each item in the MasterTableView. It doesn't. In fact it doesn't fire 'til the master table's row is expanded.

The next problem is that when the DetailTableDataBind event fires I can't get at the parent row's data object, this is, I assume, 'cos it's only available when the ItemDataBound event for that row fires.

So, just how much of what I've read in the docs have I failed to understand? 

And is it actually possible to bind a DetailTableView to the child objects of an object without going to the data store a 2nd time?

-- 
Stuart
Veli
Telerik team
 answered on 06 Jul 2010
1 answer
80 views
I've got a RadGrid that uses the basic inline insert and update functionality combined with RadComboBoxes for many of my fields in the EditItemTemplates. I want to combine my solution with the "Grid / Google-like Filtering" example that's posted at: http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandcombo/defaultcs.aspx?product=grid.

What I want to happen is an AutoPostBack when the selected item is changed in the postback that filters the table based on the "Company" chosen. I want this done using AJAX as in the example. The end result would be a hybrid of the example in the link above that includes TWO modes for the CustomFilteringColumn. If Inserting/Updating, I want the RadComboBox to display. If just viewing, I simply want a basic bound field to show. 

I've spent the past day struggling. Does anyone have any pointers?
Yavor
Telerik team
 answered on 06 Jul 2010
1 answer
207 views
Hi,
       I have bit unusual requirement. I have to apply "contains" as default filter for an Integer data type column( with AutoPostBackOnFilter="true").

Please help me regarding this.

Regards,
Dheeraj
Martin
Telerik team
 answered on 06 Jul 2010
1 answer
153 views
Hi,

We are using Telerik RadBinaryImage in our application, now I have a problem.

We create binary images dynamically and add them to a table cell. Depending on the number of images in the tabel cell we resize the images. Now the images that we add have the following conditions:

rbiImg.ResizeMode = Telerik.Web.UI.

BinaryImageResizeMode.Crop;

 

rbiImg.AutoAdjustImageControlSize =

false;

So when we resize the image it should be cropped.
We start out with an image 20px * 20px

We then resize the image to 10px * 20px and add an extra image also 10px * 20px (so in total we have 20 pixels * 20 pixels)

In the next round we resize the first image to 10x10 and the second 10x10 and add an extra image 10x20.

The second image is cropped correctly but the first image isn't cropped but it uses fit.

See the attached image:

You can see that the image (10x10) with the black has a different hatch style as the light grey image (10x10). Both images should look like the lightgrey image.

Is it because the original image (the one with the black background) was 20x20 and is at the end resized to 10x10 and the other image is resized from 10x20 to 10x10? They should be the same.

Any help would be appreciated.

Best regards Patrick

 

Rosen
Telerik team
 answered on 06 Jul 2010
1 answer
166 views
Hi,

I'm having an issue trying to get multiple events to fire within a RadGrid.  
What I'm  trying to accomplish:
1. I have a summary grid page with 5 out of 15 fields displaying in the grid.  I have set the editing to be inline since I only have a few items
2. I have a column with an image that by clicking the image the detail form with all 15 fields will display allowing the user to modify the detail form

How can this be accomplished?:

Thanks,

Here is my code - base:
C# Code for the grid item command:
  protected void dbgPolicyInformation_ItemCommand(object source, GridCommandEventArgs e) 
        { 
            if (null != e.Item) 
            { 
                switch (e.CommandName) 
                { 
                    case "Navigate": 
                        string popupScript = "<script language='javascript'>" + "window.open('/vpcleads/vpcpolicies/vpcpolicyinformation.aspx', 'CustomPopUp', " + "'width=350, height=350, menubar=yes, resizable=no')" + "</script>"; 
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "PopupScript", popupScript,false); 
                        break; 
                } 
            } 
        } 

HTML Code
RAD WINDOW MANAGER: 
<telerik:RadWindowManager Behaviors="Close" runat="server" ID="AddPolicy" Opacity="90" 
        ShowContentDuringLoad="true" KeepInScreenBounds="true" VisibleStatusbar="false" 
        Modal="true" Width="500px" Height="700px" Skin="Office2007"> 
    </telerik:RadWindowManager> 
GRID OBJECT: 
 <telerik:RadGrid ID="dbgPolicyInformation" runat="server" AutoGenerateColumns="false" 
                                        OnNeedDataSource="dbgPolicyInformation_NeedDataSource" OnItemDataBound="dbgPolicyInformation_ItemDataBound" 
                                        OnInsertCommand="dbgPolicyInformation_InsertCommand" OnDeleteCommand="dbgPolicyInformation_DeleteCommand" 
                                        OnUpdateCommand="dbgPolicyInformation_UpdateCommand" OnCancelCommand="dbgPolicyInformation_CancelCommand" 
                                        OnItemCreated="dbgPolicyInformation_ItemCreated" Skin="Office2007" ShowFooter="true" 
                                        OnItemCommand="dbgPolicyInformation_ItemCommand"> 
                                        <MasterTableView Name="Policy" DataKeyNames="PolicyId,NewPolicyId" EditMode="InPlace" 
                                            CommandItemDisplay="Top" AllowMultiColumnSorting="True" CommandItemSettings-AddNewRecordText=""> 
                                            <Columns> 
                                                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Navigate" HeaderText="View Policy Details" 
                                                    Resizable="false" Reorderable="false" UniqueName="GoToLeadDetails" ImageUrl="~/Images/preview.gif" 
                                                    Text="View Policy Details" ButtonCssClass="pointerMouseCursor" Groupable="false"> 
                                                    <HeaderStyle Width="45px" HorizontalAlign="Center" /> 
                                                    <ItemStyle Width="45px" HorizontalAlign="Center" /> 
                                                </telerik:GridButtonColumn> 
                                                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1" 
                                                    HeaderText="Quick Edit"> 
                                                    <HeaderStyle Width="20px" /> 
                                                    <ItemStyle CssClass="MyImageButton" /> 
                                                </telerik:GridEditCommandColumn> 
                                                <telerik:GridBoundColumn DataField="PolicyId" HeaderText="PolicyId" Visible="false"> 
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridBoundColumn DataField="RenewalDate" HeaderText="Renewal Date"> 
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridBoundColumn DataField="CompanyName" HeaderText="Company Name"> 
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridBoundColumn DataField="PolicyNumber" HeaderText="Policy"> 
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridBoundColumn DataField="MarketingSourceDesc" HeaderText="Marketing Source"> 
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridButtonColumn ConfirmText="Delete This Policy?" ButtonType="ImageButton" 
                                                    CommandName="Delete" Text="Delete Policy" UniqueName="DeleteColumn1"> 
                                                    <HeaderStyle Width="20px" /> 
                                                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> 
                                                </telerik:GridButtonColumn> 
                                            </Columns> 
                                        </MasterTableView>                                        
                                    </telerik:RadGrid> 
 
 

Yavor
Telerik team
 answered on 06 Jul 2010
1 answer
173 views
hello,

i want to help to find combobox  selected value in datalist(1), and the datalist(1) in datalist(2) using javascript and i want change the enable this combox when i check the checkbox in same location the combobox using javascript

thanks,
Shinu
Top achievements
Rank 2
 answered on 06 Jul 2010
1 answer
58 views
Hi.

The issue I have is a bit fiddly to explain.  We have styled our site using an IE filter to generate a background gradient.  This is defined in a stylesheet and applied via a masterpage.  Some of our pages make use of a RadWindow and the pages displayed within the RadWindow contain a Telerik TabStrip.  These pages also contain javascript to set the selected tab, as we use Response.Redirect to prevent repeating postback actions. 

It appears that the javascript is preventing the gradient filter being processed.  Curiously, this is only a problem on the inital load - if you perform a refresh / reload of the RadWindow content page, the gradient is correctly applied.

I have a sample project demonstrating the issue if required (thought I could attach it but apparently not...)
 
Any assistance would be appreciated.

Many thanks,

Keith.
Georgi Tunev
Telerik team
 answered on 06 Jul 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?