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

We have a RadGrid with Groupable columns, when the user group all the GroupHeaders has a white background with more height of usual like the first picture (CorrectLayout.jpg). When i Turn off the "AllowScroll=False" the GroupHeader layout behavior is correct for all the groups.

RadGrid aspx code:
<telerik:RadGrid ID="gridProductStore" runat="server" Skin="Windows7" AutoGenerateColumns="False"
             AllowPaging="True" AllowSorting="True" PageSize="8" 
             OnNeedDataSource="gridProductStore_NeedDataSource"
             ShowGroupPanel="true">
            <ExportSettings ExportOnlyData="True" IgnorePaging="True" HideStructureColumns="true"
                FileName="ProductStoreReport">
            </ExportSettings>
            <ClientSettings EnableRowHoverStyle="true"
                AllowDragToGroup="true"
                AllowGroupExpandCollapse="True">
                <Scrolling AllowScroll="False" UseStaticHeaders="True"></Scrolling>
            </ClientSettings>
            <GroupingSettings ShowUnGroupButton="true" />
            <MasterTableView CommandItemDisplay="Top"
                TableLayout="Auto"
                BorderStyle="None"
                ClientDataKeyNames="ProductStoreID"
                HeaderStyle-Wrap="true"
                HeaderStyle-HorizontalAlign="Center"
                ItemStyle-HorizontalAlign="Center"
                AlternatingItemStyle-HorizontalAlign="Center" >
                <CommandItemSettings ShowAddNewRecordButton="false" ShowExportToExcelButton="true">
                </CommandItemSettings>
                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                </RowIndicatorColumn>
                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="ProductStoreID" DataType="System.Int64" Visible="false"
                        FilterControlAltText="Filter ProductStoreID column" HeaderText="ProductStoreID"
                        SortExpression="ProductStoreID" UniqueName="ProductStoreID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ProductID" DataType="System.Int32" Visible="false"
                        FilterControlAltText="Filter ProductID column" HeaderText="ProductID"
                        SortExpression="ProductID" UniqueName="ProductID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="BatchID" DataType="System.Int64" HeaderStyle-Width="70px"
                        FilterControlAltText="Filter BatchID column" HeaderText="Batch N°"
                        SortExpression="BatchID" UniqueName="BatchID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ProductName" HeaderStyle-Width="180px"
                        FilterControlAltText="Filter ProductName column" HeaderText="Product Name"
                        SortExpression="ProductName" UniqueName="ProductName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ClaimCode" Groupable="false" HeaderStyle-Width="100px"
                        FilterControlAltText="Filter ClaimCode column" HeaderText="Claim Code"
                        SortExpression="ClaimCode" UniqueName="ClaimCode">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="IsSold" DataType="System.Boolean" Groupable="false" HeaderStyle-Width="70px"
                        FilterControlAltText="Filter IsSold column" HeaderText="Is Sold"
                        SortExpression="IsSold" UniqueName="IsSold">
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridBoundColumn DataField="ExpirationDate" DataType="System.DateTime" Groupable="false"
                        FilterControlAltText="Filter ExpirationDate column" HeaderText="Expiration Date"
                        SortExpression="ExpirationDate" UniqueName="ExpirationDate">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="UploadedDate" DataType="System.DateTime" Groupable="false"
                        FilterControlAltText="Filter UploadedDate column" HeaderText="Uploaded Date"
                        SortExpression="UploadedDate" UniqueName="UploadedDate">
                    </telerik:GridBoundColumn>
                </Columns>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
                <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" Position="Bottom" />
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                <AlternatingItemStyle HorizontalAlign="Center"></AlternatingItemStyle>               
                <HeaderStyle HorizontalAlign="Center" Wrap="True"></HeaderStyle>
            </MasterTableView>
        </telerik:RadGrid>


Hope you can help me with this.

Best Regards,
Eyup
Telerik team
 answered on 01 Jun 2012
5 answers
129 views
I am using Visual Studio 2008.  I have several projects using Telerik TabStrips with multipage controls.  I always work on designing the page in "Split" mode where the source is at the top of the screen and the design view is at the bottom.

One thing I find annoying is when I am working on a project, and I want to select a particular button, label, table row, or whatever within one of the PageViews.  Instead of the Source jumping me to that element and highlighting it as expected, instead I am jumped to the top of the PageView that element is contained within and the entire PageView is highlighted.  I then have to manually scroll down and find the element I was trying to access by sight.

Is there a setting or something I can do so Visual Studio will select the element contained within the PageView and not the entire PageView itself?
Kevin
Top achievements
Rank 1
 answered on 01 Jun 2012
6 answers
310 views
Hey everyone

I am using a radgrid and some GridDropDownColumns for displaying possible values when the user selects the edit command button. The problem is that the grid is displaying some values as it is supposed and others not, I am binding the grid programmatically at the code behind and sending a dataset with the values for the Master Table and for the drop down columns. The problem is only in the display, in edit mode the grid is working fine, I'm able to show the possible values in the columns as wondered.

here is the code...

aspx:

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"

        GridLines="None" MasterTableView-NoMasterRecordsText="No hay registros que mostrar">

        <MasterTableView DataKeyNames="ProductoId" Name="Productos" EditMode="InPlace">

        <Columns>

        <telerik:GridNumericColumn UniqueName="columnProductoId" HeaderText="ProductoId" DataField="ProductoId" Visible="false"></telerik:GridNumericColumn>

       

        <telerik:GridDropDownColumn UniqueName="columnTipoProducto"></telerik:GridDropDownColumn>

        <telerik:GridDropDownColumn UniqueName="columnPaisMoneda"></telerik:GridDropDownColumn>

        <telerik:GridDropDownColumn UniqueName="columnEstado"></telerik:GridDropDownColumn>

        <telerik:GridDropDownColumn UniqueName="columnOperador"></telerik:GridDropDownColumn>

       

        <telerik:GridBoundColumn UniqueName="columnDescripcion" HeaderText="Descripcion" DataField="Descripcion">

        </telerik:GridBoundColumn>

        <telerik:GridNumericColumn  UniqueName="columnValor" HeaderText="Valor" DataField="Valor">

        </telerik:GridNumericColumn>

       

        <telerik:GridDateTimeColumn UniqueName="columnFechaRegistro" HeaderText="Fecha de Registro" DataField="FechaRegistro">

        </telerik:GridDateTimeColumn>

        <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" EditText="Editar">

        </telerik:GridEditCommandColumn>

        <telerik:GridButtonColumn CommandName="Delete" ConfirmDialogType="RadWindow" ConfirmText="Está seguro de que desea eliminar este producto?" Text="Eliminar" UniqueName="DeleteColumn">

        </telerik:GridButtonColumn>

        </Columns>

            <RowIndicatorColumn>

                <HeaderStyle Width="20px" />

            </RowIndicatorColumn>

            <ExpandCollapseColumn>

                <HeaderStyle Width="20px" />

            </ExpandCollapseColumn>

        </MasterTableView>

    </telerik:RadGrid>

vb code behind:

Private Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource

        Try

            Me.RadGrid1.DataSource = Me.FuenteDatosGrillaPinesProducto

            'here is where i send the dataset with all the DataTable               needed

            Me.RadGrid1.DataMember = "Tabla Pines Producto"

            Dim columna As GridDropDownColumn

 

            columna = Me.RadGrid1.Columns(1)

            With columna

                .DataSourceID = Me.RadGrid1.DataSourceID

                .HeaderText = "Tipo de producto"

                .DataField = "TipoProductoId"

                .ListTextField = "Descripcion"

                .ListValueField = "TipoProductoId"

                .DataSourceID = "Pines Productos"

                .ListDataMember = "Tabla Tipos Producto"

            End With

 

            columna = Me.RadGrid1.Columns(2)

            With columna

                .DataSourceID = Me.RadGrid1.DataSourceID

                .HeaderText = "Pais"

                .DataField = "PaisMonedaId"

                .ListTextField = "Descripcion"

                .ListValueField = "PaisId"

                .DataSourceID = "Pines Productos"

                .ListDataMember = "Tabla Paises"

            End With

 

            columna = Me.RadGrid1.Columns(3)

            With columna

                .DataSourceID = Me.RadGrid1.DataSourceID

                .HeaderText = "Estado"

                .DataField = "EstadoId"

                .ListTextField = "Descripcion"

                .ListValueField = "EstadoId"

                .DataSourceID = "Pines Productos"

                .ListDataMember = "Estados"

            End With

 

            columna = Me.RadGrid1.Columns(4)

            With columna

                .DataSourceID = Me.RadGrid1.DataSourceID

                .HeaderText = "Operador"

                .DataField = "OperadorId"

                .ListTextField = "Descripcion"

                .ListValueField = "OperadorID"

                .DataSourceID = "Pines Productos"

                .ListDataMember = "Tabla Operadores"

            End With

 

        Catch ex As Exception

 

        End Try

    End Sub

the result is something like this:
Tipo de producto   Pais            Estado                 Operador     Descripcion   Valor   Fecha Registro
PINEs                     Colombia    Producto Activo   Operador1   Pin de 500     500     13/03/2009
                                                                                                 Pin de 1000  1000    13/03/2009
PINEs                     Venezuela   Producto Activo   Operador1  Pin de 500     500     13/03/2009

as you can see the second row doesn't show anything on the columns that are grid drop down columns.

I don't know if you got the idea of my problem so far, thanks for your time
Tsvetoslav
Telerik team
 answered on 01 Jun 2012
4 answers
278 views
Hello team

I've the following code for exporting a grid in various formats.

            if (ddlRBExportFormat.SelectedValue.Equals("MSExcel", StringComparison.InvariantCultureIgnoreCase)) 
            { 
                rgReportBuilder.MasterTableView.ExportToExcel(); 
            } 
            else if (ddlRBExportFormat.SelectedValue.Equals("MSWord", StringComparison.InvariantCultureIgnoreCase)) 
            { 
                rgReportBuilder.MasterTableView.ExportToWord(); 
            } 
            else if (ddlRBExportFormat.SelectedValue.Equals("PDF", StringComparison.InvariantCultureIgnoreCase)) 
            { 
                rgReportBuilder.MasterTableView.ExportToPdf(); 
            } 
            else if (ddlRBExportFormat.SelectedValue.Equals("CSV", StringComparison.InvariantCultureIgnoreCase)) 
            { 
                rgReportBuilder.MasterTableView.ExportToCSV(); 
            } 

I've huge number of records in the grid. When i do an export i get OutOfMemoryException. Is there a workaround to eliminate this error?

Thank you

Regards
NLV

Jayesh Goyani
Top achievements
Rank 2
 answered on 01 Jun 2012
1 answer
59 views
Hi,

From the example on this page http://demos.telerik.com/aspnet-ajax/scheduler/examples/optimizedqueries/defaultcs.aspx# 

SELECT * FROM [Appointments] WHERE ([Start] < @RangeEnd AND [End] > @RangeStart) OR ([RecurrenceRule] <> '') OR ([RecurrenceParentID] IS NOT NULL) 

I see that the select statement retrieved recurring events events using [RecurrenceRule] <> '' which is good. My question is why do you need the "OR ([RecurrenceParentID] IS NOT NULL)" ? From what I understand, an appointment has RecurrenceParentID only when it's modified from a recurring series and then a new row in Appointments table will be created. The first where clause (start < @rangeEnd...) should already retrieve those in the visible start/end. If you include the RecurrenceParentID IS NOT NULL wouldn't that unnecessary retrieve more appointments than needed?

Thanks
 

Plamen
Telerik team
 answered on 01 Jun 2012
1 answer
59 views
Hi,
I am binding ResourceType  from code behind

ResourceType rt = new ResourceType("UserCalender");          
rt.ForeignKeyField = "UserTypeId";
rt.KeyField = "UserTypeId";
rt.TextField = "UserTypeName";         
rt.DataSource = GetUserTypes();
RadScheduler1.ResourceTypes.Add(rt);

on my New Appointment window shows extra "-" item.
I do not want that Extra  "-" item in my combobox.  
How do i remove that?

Plamen
Telerik team
 answered on 01 Jun 2012
5 answers
201 views
Hi,
       I am trying to resize the Raddoc at codebehind. But its not working. 

<telerik:RadDockLayout runat="server" ID="RadDockLayout1" OnSaveDockLayout="RadDockLayout1_SaveDockLayout"
                                OnLoadDockLayout="RadDockLayout1_LoadDockLayout" >
                                <telerik:RadDockZone runat="server" ID="RadDockZone1" Width="300" MinHeight="500"
                                    Style="float: left; margin-right: 15px" >
                                </telerik:RadDockZone>
                                <telerik:RadDockZone runat="server" ID="RadDockZone2" Width="300" MinHeight="300"
                                    Style="float: left; margin-right: 15px; background: #f5f4e8;">      
                                </telerik:RadDockZone>
                                <telerik:RadDockZone runat="server" ID="RadDockZone3" Width="300" MinHeight="300"
                                    Style="background: #d5f0fa; float: left;">
                                </telerik:RadDockZone>
                            </telerik:RadDockLayout>


private RadDock CreateRadDock()
        {
            int docksCount = CurrentDockStates.Count;
 
            RadDock dock = new RadDock();
            dock.DockMode = DockMode.Docked;
            dock.UniqueName = Guid.NewGuid().ToString().Replace("-", "a");
            dock.ID = string.Format("RadDock{0}", dock.UniqueName);
            dock.Title = txtDocTitle.Text;
            dock.Text = string.Format("Added at {0}", DateTime.Now);
            dock.Resizable = true;
            dock.Commands.Add(new DockCloseCommand());
            dock.Commands.Add(new DockExpandCollapseCommand());
 
            return dock;
        }

Can we resize "RadDockZone" also ??

waiting for reply...!!!
Princy
Top achievements
Rank 2
 answered on 01 Jun 2012
1 answer
77 views

the field in the database is a varbinary (max)
I have
the following in html:
<asp:Repeater ID="Repeater1" runat="server">
            <ItemTemplate>
                <telerik:RadBinaryImage ID="ImgFoto" runat="server" Visible="true" DataValue='<%#Eval("foto") %>' />
            </ItemTemplate>
        </asp:Repeater>

In the code: object[] opParametros = new object[1];
            opParametros[0] = "93";
             DsInfoEmpleado = _fwAccesoDatos.ExecuteDataset(StrCadenaConexion, "spObtenerInfoPerfilEmpleado", opParametros);
             Repeater1.DataSource = DsInfoEmpleado;
            Repeater1.DataBind();

in web.config:
<handlers>
            <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode"     path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
    </handlers>

the image is not displayed. Thank you for your help.
Tsvetina
Telerik team
 answered on 01 Jun 2012
6 answers
185 views
I have
  1. A couple of dropdown lists in my RadGrid
  2. A multilingual application, such that the ViewModel provides an object for each property, but getting the display text requires a translation step to the user's language - can't just display the ViewModel property directly.  I guess I COULD change this to have one property on the ViewModel that returns the string display value and another that returns the integer underlying value, but that seems messy to me - would much prefer a solution like IValueConverter to convert between the ViewModel and the displayed value based on the type of the property.  Is that the "best practice"?  Will that cause extra server round-trips, because the property that the client side form binds to requires server side logic to execute in order to produce its value?
  3. A form template for my EditForm

I want to have a clean code-behind that uses binding to populate the list values and the selected index in the dropdown lists in both the MasterTableView and the Edit Form's FormTemplate.

I can make it work without adding the strings and integer fields to the ViewModel, but the code behind is extensive and messy.  I can't figure out any clean way to do it.  

I looked at the GridDropDownColumn control, but found that it's supposed only to have datatables underlying it (http://www.telerik.com/community/forums/aspnet/grid/populating-griddropdowncolumn-from-code-behind.aspx), and only found examples of it being bound to a source whose connection string etc. were declared in the .aspx (not in the code behind).  I'm retrieving my values via Entity Framework and then a subsequent manipulation to acquire the values for the correct language, so that doesn't work for me.

I can't declaratively specify the options for the dropdown list in the .aspx due to the need to translate them, but if I don't declare them in the XAML, then I can't bind the selected value, because it finds that the corresponding list item doesn't exist.  I also can't even bind the selected value in the case of the MasterTableView's view mode entry because of the need to translate the text to be displayed using a function that's called server side.

As-is, in ItemDataBound, for EACH dropdown field in my form, there's code to:
  1. Populate dropdown values list manually in Edit Form (requires casting the bound item, getting the list of values with translations, and manually creating ListItems
  2. Setting selected item in Edit Form (reading the value from the underlying data source item and using .FindControl to get the control that I need to update)
  3. Setting default value for the dropdown list in the Insert form
  4. Set value for the field in the MasterTableView (again doing the translation)

Seems like a lot of code to have for each field.  Seems like there should be some point BEFORE databinding where I can set the list items in the dropdownlist control, so that the databinding can go through successfully.  Just because I need to set the list items in code behind, why should I ALSO be forced to set the selected item there?

Is there a better way?

Thanks!




Abisek
Top achievements
Rank 1
 answered on 01 Jun 2012
8 answers
363 views
HI
I have a requirement as given below.
My page is for setting schedules for doctors.
For eg: Doctor X has schedule on a particular date from 09.00 am to 1.00 pm.And I have a master page with rad scheudler to set this appointment.
In another page with rad scheduler, I need to display the available time slot of Doctor X.
For that I need to show the time slot from 09.00 am to 1.00 pm empty.And need to show other time slots in a diffrent colour grey.
ie; time from 12.00 am to 08.59 am of the same date (which is unavailable schedule for the doctor) to be shown in grey colour.
time from 09.00 am to 1.00 pm as free slot.
1.01 pm to 11.59pm  (which is again unavailable for the doctor)  in grey colour.

Please help, as I am stuck here.have done so many R&D,nothing helped.
Thanks
Chinnu


Ivana
Telerik team
 answered on 01 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?