Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
28 views
.... MultipleEditGrid. I need to check for unsaved records on PageChange and If I find any records in EditItems call .Save function on eachControl. I Guess I can just remove record from EditItems if saving was ok.

Is it also possible to check for unsaved revords on page_unload?

//h
Iana Tsolova
Telerik team
 answered on 02 Feb 2011
4 answers
264 views
Hi there

I am quite familiar with loading images into SQL using file streams and blob data and can happily output them to a page using a handler or other means (assume your binary image control is straight forward).

Is there any way of inserting a binary image (or at least an image or document) from within a database using the RadEditor control. In essence I need an image manager that takes images from a database rather than from the file system.

I'm also sure I could probably do it by typing in the correct code but this needs to be possible for an end user.

Thanks for any comments

Martyn Fewtrell
http://www.networkclub.co.uk
Martyn Fewtrell
Top achievements
Rank 1
 answered on 02 Feb 2011
1 answer
87 views
Hi, I just saw that when I close the advanced form popup window the scheduler rebinds.
Can I prevent this?
And why does it reloads in first place? If nothing is changed there is no reason to rebind or?!

Regards,
Mattias
Peter
Telerik team
 answered on 02 Feb 2011
1 answer
145 views
I am trying to implement your demo . With debug I can see that in default.aspx.vb codebehind, proper values are being assigned to the custom session variables in custom class (e.g.: config.userID). However, I realized that the custom session variables in ashx handlers always returns null values. When I hardcode those variables in the ashx handlers, demo works just fine. I am using VS2010 premiun (visual basic) and Telerik 2010.3.1215.40

How can I make those custom class variables return correct values instead of null values?

Thank you.
Genady Sergeev
Telerik team
 answered on 02 Feb 2011
9 answers
154 views
I have a radTabStrip inside a radWindow. Scrolling on the tabstrip is set to true. When I resize the radWindow the scroll buttons do not appear or disappear when the window is resized, only when I click a tab and load a new multipage.

Additionally, if you have the tab strip scrolled all the way to the right and click on one of the tabs, the scroller loses track of where things are. It will subsequently scroll too far to the right, but not far enough to the left.
Helen
Telerik team
 answered on 02 Feb 2011
1 answer
166 views
Hello,

I setup a custom color picker in a radgrid column like so:

<telerik:GridTemplateColumn 
    DataField="Color"
    UniqueName="Color"
    SortExpression="Color"
    HeaderText="Color"
    HeaderStyle-Width="100" 
    ItemStyle-HorizontalAlign="center"                                        
    AllowFiltering="false">
    <ItemTemplate>
        <asp:Label id="lblColor" runat="server" ></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
        <telerik:RadColorPicker ID="RadColorPicker1" Runat="server"  Skin="WebBlue" Preset="None" >
           <telerik:ColorPickerItem Title="rsCategoryDarkBlue" Value="#202B3F" />
           <telerik:ColorPickerItem Title="rsCategoryBlue" Value="#CCCCFF" />
           <telerik:ColorPickerItem Title="rsCategoryDarkGreen" Value="#2B3F20" />
           <telerik:ColorPickerItem Title="rsCategoryGreen" Value="#D0ECBB" />
           <telerik:ColorPickerItem Title="rsCategoryDarkRed" Value="#3F2020" />
           <telerik:ColorPickerItem Title="rsCategoryOrange" Value="#EDD5B7" />
           <telerik:ColorPickerItem Title="rsCategoryPink" Value="#F1DCFF" />
           <telerik:ColorPickerItem Title="rsCategoryRed" Value="#ECBBBB" />
           <telerik:ColorPickerItem Title="rsCategoryViolet" Value="#540042" />
           <telerik:ColorPickerItem Title="rsCategoryYellow" Value="#FFFAC5" />
        </telerik:RadColorPicker>
    </EditItemTemplate>
</telerik:GridTemplateColumn>

I'd like to be able to grab the title of the selected color on the server side.
protected void radGridStages_InsertCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
    //Get the GridEditFormInsertItem of the RadGrid     
    GridDataInsertItem insertedItem = (GridDataInsertItem)e.Item;
    //string EmployeeID = (insertedItem["EmployeeID"].Controls[0] as TextBox).Text;   
    try
    {
            //load the lookup
            Stage _stage = new Stage();
            //change the name
            _stage.Name = (insertedItem["Name"].Controls[0] as TextBox).Text;
            _stage.Code = (insertedItem["Code"].Controls[0] as TextBox).Text;
            _stage.Color = (insertedItem["Color"].Controls[1] as RadColorPicker).SelectedColor.ToArgb();
            //_stage.CssStyle = (insertedItem["Color"].Controls[1] as RadColorPicker).SelectedColorTitle;
            _stage.Active = (insertedItem["Active"].Controls[0] as CheckBox).Checked;
            StageService.Save(_stage);
            radGridStages.Focus();
    }
    catch (Exception ex)
    {
        lblMessage.Text = "Unable to insert Stage. Reason: " + ex.Message;
        e.Canceled = true;
    }
}

The problem is that there is no attribute server side to grab the title.  I could put in a long-winded select case statement but it seems like it should be easier.

Thanks
Jonathan
Tsvetie
Telerik team
 answered on 02 Feb 2011
2 answers
108 views
Hi,

I Need trigger Server event Load for RadTextbox without page postback, using client side javascript.
I tried sender.raise_load(Sys.EventArgs.Empty); in javascript function from button click event, but not work.
Any help is welcome.

Thanks advanced.

Roberto
Roberto
Top achievements
Rank 1
 answered on 02 Feb 2011
1 answer
54 views
Hi,

I currently have a PanelBar with 4 PanelBarItems. I recently started adding AJAX to my page using AJAX Manger, AJAX Manager Proxy, and AJAX Loading Panel. All has gone well until I tried AJAXifying my RadPanelBar.

To start off, lets call my  4 PanelBarItems Item1, Item2, Item3, and Item4.

In Item1, Users are given a bunch of options to Create a report the way they want it. After choosing their options they can click the "Build Report" button to Generate the Report. After the user has clicked the button a number of things happen:

1. The options of the report are inputted, starting the Method to dynamically create the Report.
2. Item1 is closed
3. The Report is then Viewed in a ReportViewer in Item4
4. Item4 is expanded to show the dynamic report.

Now, this all works fine without using AJAX and doing a full postback, but unfortunately it would be a lot smoother if this could happen with AJAX.
I have set up Panels around the contents of each item for Refreshing Panels and such, and this all works great, but I am having trouble Closing and Opening RadPanelItems with AJAX. I have also tried setting up a Panel around the whole PanelBar, but had no such luck getting this to work properly. I have also tried setting the UpdatedControls to the PanelBar ID itself, but also no luck.

Is it possible to expand, contract and update PanelBarItems with AJAX?

Best Regards,

Landon
Yana
Telerik team
 answered on 02 Feb 2011
1 answer
833 views
Hello,

please give me some information about loading a bitmap from memory.

I have tried it with

 

Dim stream As New System.IO.MemoryStream

 

Bmp1.Save(stream, System.Drawing.Imaging.ImageFormat.Png)

Image1.DataValue = stream.GetBuffer()

Image1.DataBind()


in CodeBehind. Bmp1 is a bitmap that is created and modified in code before.

No image is displayed. What do I have to do? I think I have not already understood the idea of binary image.

Thanks in advance

René
Rene
Top achievements
Rank 1
 answered on 02 Feb 2011
1 answer
80 views
Is there an example showing how to implement the recent provider changes for sending additional information to the provider? I'm working on a custom provider that does NOT use an XML data source and I'm looking mainly at the Implementing A Provider That Supports Multi-valued Resources example, but it is still using the old implementation. I understand what the changes are, but I'm having trouble converting the old "GetResourceTypes" and "GetResourceByType" methods to the new "GetResources" method.

Basically I need help converting the following code to the new "GetResources" implementation. Any help would be greatly appreciated.

public override IEnumerable<ResourceType> GetResourceTypes(RadScheduler owner)
{
  ResourceType[] resourceTypes = new ResourceType[2];
  resourceTypes[0] = new ResourceType("Teacher", false);
  resourceTypes[1] = new ResourceType("Student", true);
  return resourceTypes;
}
public override IEnumerable<Resource> GetResourcesByType(RadScheduler owner, string resourceType)
{
  switch (resourceType)
  {
     case "Teacher" :
         return Teachers.Values;
     case "Student" :
         return Students.Values;
     default:
         throw new InvalidOperationException( "Unknown resource type: " + resourceType);
  }
}
private IDictionary<int, Resource> Teachers
{
   get
   {
       if (_teachers == null)
       {
           _teachers = new Dictionary<int, Resource>();
           foreach (Resource teacher in LoadTeachers())
           {
               _teachers.Add((int)teacher.Key, teacher);
           }
       }
       return _teachers;
   }
}
private IDictionary<int, Resource> Students
{
   get
   {
       _students = new Dictionary<int, Resource>();
       foreach (Resource student in LoadStudents())
       {
           _students.Add((int)student.Key, student);
       }
       return _students;
   }
}
private IEnumerable<Resource> LoadTeachers()
{
  List<Resource> resources = new List<Resource>();
  using (DbConnection conn = OpenConnection())
  {
      DbCommand cmd = DbFactory.CreateCommand();
      cmd.Connection = conn;
      cmd.CommandText = "SELECT [TeacherID], [Name], [Phone] FROM [DbProvider_Teachers]";
      using (DbDataReader reader = cmd.ExecuteReader())
      {
         while (reader.Read())
         {
            Resource res = new Resource();
            res.Type = "Teacher";
            res.Key = reader["TeacherID"];
            res.Text = Convert.ToString(reader[ "Name" ]);
            res.Attributes["Phone"] = Convert.ToString(reader["Phone"]);
            resources.Add(res);
         }
      }
  }
  return resources;
}
 
private IEnumerable<Resource> LoadStudents()
{
  List<Resource> resources = new List<Resource>();
  using (DbConnection conn = OpenConnection())
  {
      DbCommand cmd = DbFactory.CreateCommand();
      cmd.Connection = conn;
      cmd.CommandText = "SELECT [StudentID], [Name] FROM [DbProvider_Students]";
      using (DbDataReader reader = cmd.ExecuteReader())
      {
          while (reader.Read())
          {
              Resource res = new Resource();
              res.Type = "Student";
              res.Key = reader["StudentID"];
              res.Text = Convert.ToString(reader[ "Name" ]);
              resources.Add(res);
          }
      }
  }
  return resources;
}
Peter
Telerik team
 answered on 02 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?