Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
102 views
Hello All:
New to the product, just purchased it last week.
What I am trying to do is take a table, in the following format, and be able to pivot (transpose rows and columns), but also be able to insert/update from this mode.

CREATE TABLE [dbo].[tablename](
[lbrID] [bigint] IDENTITY(1,1) NOT NULL,
[lbrDate] [date] NOT NULL,
[lbrName] [varchar](128) NOT NULL,
[lbrStore] [varchar](3) NOT NULL,
[lbrTime1] [money] NULL,
[lbrTime2] [money] NULL,
[lbrTime3] [money] NULL,
[lbrTime4] [money] NULL,
[lbrTime5] [money] NULL,
[lbrTime6] [money] NULL,
[lbrTime7] [money] NULL,
[lbrTime8] [money] NULL,
[lbrTime9] [money] NULL,
[lbrTime10] [money] NULL,
[lbrReconcile1] [money] NULL,
[lbrTime11] [money] NULL,
[lbrTime12] [money] NULL,
[lbrTime13] [money] NULL,
[lbrTime14] [money] NULL,
[lbrTime15] [money] NULL,
[lbrTime16] [money] NULL,
[lbrReconcile2] [money] NULL,
[lbrTime17] [money] NULL,
[lbrTime18] [money] NULL,
[lbrTime19] [money] NULL,
[lbrTime20] [money] NULL,
[lbrReconcile3] [money] NULL,
[lbrTotal] [money] NULL
) ON [PRIMARY]

Basically take that table, and have the lbrName as the columns (for each distinct name for that date) and the lbrTimes as the rows.

which grid would I be best to use? I got radGrid to work with a C# transpose (found online), this requires autogenerate columns, and it does not look like I could do inserts/edits inline with this.

I tried playing around with pivotGrid but could not get it displaying like I wanted. Perhaps I was missing something there.

Thanks in advance for any help
Kostadin
Telerik team
 answered on 10 Apr 2014
5 answers
174 views
Hi,

I have a grid in the RadAjaxPanel, which has a column with a asp button. Also, the same column has display none div with all the html need for tooltip. I want to use this div as tooltip when the user mouse over this button. Also, this div has links that are clickable. So, how do I use RadToolTipManager or RadToolTip to show the tool tip. Any help is greatly appreciated.

Thanks,
Ana
Marin Bratanov
Telerik team
 answered on 10 Apr 2014
7 answers
463 views
Hi, I am new to telerik and let me know how I can disable the postback RadGrid to expand.
by pressing + and expand launches a postback that is uncomfortable.
I hope your help greetings.
can with updatepanel?
a example pliss


Rachana
Top achievements
Rank 1
 answered on 10 Apr 2014
1 answer
192 views
Hi, how to set an empty datasource at first?
Princy
Top achievements
Rank 2
 answered on 10 Apr 2014
1 answer
63 views
Hello,
  I want to bind data with RadTileList and set paging to radtilelist. i have searched on google but no luck pl help me how to bind and pagination with RadTileList control its very urgent
Marin Bratanov
Telerik team
 answered on 10 Apr 2014
8 answers
233 views
I have dfdfdf
I have a user that demands we cannot continue with the project because the textbox height increases after selecting and account.  I have attached an image to show that they are seeing.  Can someone let me know how I can prevent the textbox height from changing?
  
Thank you!
  
Here is my code
<telerik:RadAutoCompleteBox ID="RadAutoCompleteBoxESI" 
EmptyMessage="Please type ESI Number here"  
InputType="Text"  
DropDownWidth="200" 
Width="200"  
runat="server" >
 <TextSettings SelectionMode="Single" />
</telerik:RadAutoCompleteBox>
Vignesh
Top achievements
Rank 1
 answered on 10 Apr 2014
2 answers
142 views
Hello Community!

I am trying to find a solution to dynamically create TabStrip with MultiPage and Pageviews with UserControls from a SQL database.

Here is what I have thus far.
SQL Table: ID, ParentID, TabName, URL, Position, NavBar, Page, and Active columns.
I store the path to the webpage and UserControls in the URL column.
The rest of the columns are for sorting and visibility per user/page/etc.

Here is my HeaderControl.ascx code.
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" SelectedIndex="0" CausesValidation="False" Skin="Black" Width="100%"></telerik:RadTabStrip>
 
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0"></telerik:RadMultiPage>

Here is my codeBehind.
public int _Page;
 
protected void Page_Load(object sender, EventArgs e)
{
    int _FID = Convert.ToInt32(Session["_FID"]);
    int _AID = Convert.ToInt32(Session["_AID"]);
 
    IMasterPage masterPage = Page.Master as IMasterPage;
    if (masterPage.bodyID == "DB")
    {
        _Page = 1;
        Page.Title = string.Format("Virtual Law Desk :: Dashboard");
    }
    else if (masterPage.bodyID == "CM")
    {
        _Page = 2;
        Page.Title = string.Format("Virtual Law Desk :: Client Management");
    }
 
 
    StandardClass SC = new StandardClass();
    {
        if (!SC.IsError)
        {
            SC.ReturnLawfirmUser(_FID, _AID);
            {
                fnLbl.Text = SC.FirstName;
                lnLbl.Text = SC.LastName;
            }
        }
    }
 
    NavigationClass NC = new NavigationClass();
    {
        if (!NC.IsError)
        {
 
            RadMenu1.DataSource = NC.ReturnTabNavigation();
            RadMenu1.DataTextField = "tabname";
            RadMenu1.DataNavigateUrlField = "url";
            RadMenu1.DataValueField = "pid";
            RadMenu1.DataFieldID = "id";
            RadMenu1.DataBind();
 
            RadTabStrip1.DataSource = NC.ReturnSubTabNavigation(_Page);
            RadTabStrip1.DataTextField = "tabname";
            //RadTabStrip1.DataNavigateUrlField = "url";
            RadTabStrip1.DataValueField = "pid";
            RadTabStrip1.DataFieldID = "id";
            RadTabStrip1.SelectedIndex = -1;
            RadTabStrip1.DataBind();
 
            RadPageView pageView = new RadPageView();
            pageView.ID = "pid";
            RadMultiPage MultiPage1 = RadMultiPage1;
            MultiPage1.PageViews.Add(pageView);
 
            NC.ReturnUserControls(_Page);
            {
                Control userControl = Page.LoadControl(NC.URL);
                pageView.Controls.Add(userControl);
            }
        }
    }
}

All classes are derived from a class.dll file I have created. Everything work perfectly except the UserControls for each of the PageViews. Each Main Navigation when clicked on will produce Sub Navigation Tabs which works fine. The PageViews are created as well but each of those PageViews will have a different UserControl. These UserControls paths are read from the URL column in SQL. BAsed on the NC.ReturnUserControls Class how can I make this work? Am I missing an iteration or something like it?

Thanks for any replies!




ADAPT
Top achievements
Rank 2
 answered on 10 Apr 2014
1 answer
74 views
How would you go about trying to group a certain range of years within a custom column group interval?

Wanted:
1992-2009 | 2010 | 2011 | 2012 | 2013 | 2014

Caveat: the 1992-2009 range is from the oldest date in the dataset to the oldest date with a stop at 5 years from the current year. So in 2015 the group would be 1997-2010

Current (not working) code below produces what I find unexpected:
1992-2009 | 1993 - 2009 | 1994 - 2009 etc etc

Any advice is greatly appreciated

public class OldYearGroup : IComparable, IComparable<OldYearGroup>, IEquatable<OldYearGroup>
{
    public OldYearGroup()
    {
 
    }
 
    internal OldYearGroup(int year)
    {
        this.year = year;
    }
 
    public int year
    {
        get;
        set;
    }
 
    public override string ToString()
    {
        if (year > DateTime.Now.AddYears(-5).Year)
            return string.Format(CultureInfo.InvariantCulture.NumberFormat, "{0}", this.year);
 
        return string.Format(CultureInfo.InvariantCulture.NumberFormat, "{0}-{1}", this.year, DateTime.Now.AddYears(-5).Year);
    }
 
    public override int GetHashCode()
    {
        return this.year * 7933;
    }
 
    public override bool Equals(object obj)
    {
        return this.Equals(obj as OldYearGroup);
    }
 
    public int CompareTo(object obj)
    {
        if (obj is OldYearGroup)
        {
            return this.CompareTo(obj as OldYearGroup);
        }
 
        throw new ArgumentException("Can not compare.", "obj");
    }
 
    public int CompareTo(OldYearGroup other)
    {
        if (other == null)
        {
            throw new ArgumentNullException("other");
        }
        return this.year.CompareTo(other.year);
    }
 
    public bool Equals(OldYearGroup other)
    {
        return other != null && this.year < DateTime.Now.AddYears(-5).Year;
    }
}


public class DefaultDateTimeGroupingDescription : PropertyGroupDescriptionBase
{
    public int Year { get; set; }
    public DefaultDateTimeGroupingDescription()
    {
 
    }
 
    protected override object GroupNameFromItem(object item, int level)
    {
 
        var baseValue = base.GroupNameFromItem(item, level);
         
        DateTime? year = ((DateTime?)baseValue);
        if (!year.HasValue)
            return null;
        return new OldYearGroup(year.Value.Year);
         
    }
 
    protected override void CloneOverride(Cloneable source)
    {
        var castedSource = source as DefaultDateTimeGroupingDescription;
        if (castedSource == null)
            return;
        if (castedSource.Year < this.Year)
            this.Year = castedSource.Year;
    }
 
    protected override Cloneable CreateInstanceCore()
    {
        return new DefaultDateTimeGroupingDescription();
    }
}

public class DefaultDateTimeGroupingField : PivotGridColumnField
{
    private GroupDescription _groupDescription;
 
    public override GroupDescription GroupDescription
    {
        get
        {
            if (_groupDescription== null)
            {
                _groupDescription = new DefaultDateTimeGroupingDescription();
            }
            return _groupDescription;
        }
        set
        {
            base.GroupDescription = value;
        }
    }
}
Marin
Telerik team
 answered on 10 Apr 2014
1 answer
38 views
I am using rad grid with webapi data source
the problem when i add a image column the image still empty
this is my grid
<telerik:RadGrid runat="server" ID="grdUsers" AllowPaging="true" AllowSorting="true"
                                    AllowFilteringByColumn="true" PageSize="5">
                                    <MasterTableView AutoGenerateColumns="False" DataKeyNames="Id" ClientDataKeyNames="Id,PasswordHash">
                                        <PagerStyle Mode="NumericPages" AlwaysVisible="true" />
                                        <Columns>
                                              <telerik:GridImageColumn DataType="System.String" DataImageUrlFields="Image" AlternateText="User image" 
                                                   UniqueName="Image"
                                                    ImageAlign="Middle" ImageHeight="50px" ImageWidth="50px" AllowFiltering="false" HeaderText="">
                                                </telerik:GridImageColumn>
                                            <telerik:GridBoundColumn  DataField="UserName" HeaderText="User Name"   UniqueName="UserName"
                                                  DataType="System.String">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn  DataField="FullName" HeaderText="Name" UniqueName="FullName"  
                                                  DataType="System.String">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn  DataField="Email" HeaderText="Email"  UniqueName="Email"
                                                  DataType="System.String">
                                            </telerik:GridBoundColumn>
                                             <telerik:GridBoundColumn DataField="RegistrationDate" HeaderText="Registration Date" UniqueName="RegistrationDate"  
                                                    DataFormatString="{0:dd/MM/yyyy}">
                                               </telerik:GridBoundColumn>
                                            <telerik:GridButtonColumn UniqueName="btnEdit"  ButtonType="PushButton" Text="Edit" CommandName="Edit"></telerik:GridButtonColumn>
                                            <telerik:GridButtonColumn UniqueName="btnDelete" ButtonCssClass="del" ButtonType="PushButton" Text="Delete" CommandName="Delete"></telerik:GridButtonColumn>
                                        </Columns>
                                    </MasterTableView>
                                    <ClientSettings>
                                        <Selecting AllowRowSelect="True" />
                                        <ClientEvents OnCommand="RadGridCommand" />
                                        <DataBinding Location="/SecuHostapi/Security/User/GetAll"  ResponseType="JSON">
                                            <DataService TableName="SecuHostUser" Type="OData" />
                                        </DataBinding>
                                    </ClientSettings>
                                </telerik:RadGrid>

and the result like the attachment
Radoslav
Telerik team
 answered on 10 Apr 2014
5 answers
454 views
Hi,

I have a required field validator and a custom validator tied to an asp:textbox within a RadGrid.  The required field validator fires and displays my error message when the textbox is empty.  The custom validator fires its OnServerValidate call, my code checks the text length and sets the args.IsValid = false if the text is too large.

But the Update continues to proceed and tries to update the database with some text that is too large for the database field.
The custom validator error message never displays.

What am I missing?

 

<EditItemTemplate>

 

 

 

    <asp:TextBox ID="txbDescription" Style="width: 390px; margin-left: 4px;" runat="server"

 

 

        TextMode="MultiLine" Rows="3" Text='<%# Bind("Description") %>' MaxLength="1000" Wrap="true" />

 

 

 

    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txbDescription"

 

 

        ErrorMessage="A Document description is required" Enabled="true" runat="server">

 

 

    </asp:RequiredFieldValidator>

 

 

    <asp:CustomValidator ID="val_txbDescription" Enabled="true" runat="server"

 

 

        ErrorMessage="Description is too large. Please limit text to 1000 characters."

 

 

        OnServerValidate="val_txbDescription_ServerValidate" Display="Dynamic" ControlToValidate="txbDescription">

 

 

    </asp:CustomValidator>

 

 

 

</EditItemTemplate>

 

 

 

 

protected

 

void val_txbDescription_ServerValidate(object source, ServerValidateEventArgs args)

 

{

args.IsValid =

true;

 

 

if (args.Value.Length > 1000) args.IsValid = false;

 

}

 
Princy
Top achievements
Rank 2
 answered on 10 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?