Wednesday, January 18, 2012

First Column of RadGrid to stay visible

Problem: I have many columns in my RadGrid ,I want first column to stay visible while scrolling.Only first column should appear all the time.
Solution: This can be done using FrozenColumnsCount in ClientSettings tag.

Example:
<telerik:RadGrid ID="radGridServices" runat="server">
    <MasterTableView CommandItemDisplay="Top" DataKeyNames="Services_ID_PK" ClientDataKeyNames="Services_ID_PK">
    </MasterTableView>
    <ClientSettings>
        <Scrolling AllowScroll="true" FrozenColumnsCount="1" SaveScrollPosition="true" UseStaticHeaders="true" />
        <ClientEvents />
    </ClientSettings>
</telerik:RadGrid>



Monday, January 16, 2012

Simple handling Of Events In Visual Basic .NET 4.0 Using Handler

Problem: How to handle events in Visual Basic .NET 4.0 using Handler ? 
Solution: Just Copy The Whole Code Below in Console Application

VB Code:
Module Module1
    Sub Main()
        Dim objWork As New Worker
        AddHandler objWork.WorkDone, AddressOf work_WorkDone
        objWork.DoWork()
    End Sub

    Private Sub work_WorkDone(ByVal completedWork As Integer)
        Console.WriteLine(completedWork)
    End Sub
End Module

Public Class Worker
    Public Event WorkDone(ByVal completedWork As Integer)
    Public Sub DoWork()
        For completedWork As Integer = 1 To 100
            System.Threading.Thread.Sleep(1000)
            RaiseEvent WorkDone(completedWork)
        Next
    End Sub
End Class

C# Code:
using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics; 
 
static class Module1
{
   public static void Main()
   {
     Worker objWork = new Worker();
     objWork.WorkDone += work_WorkDone;
     objWork.DoWork();
   }
}

private static void work_WorkDone(int completedWork)
{
   Console.WriteLine(completedWork);
}

public class Worker
{
   public event WorkDoneEventHandler WorkDone;
   public delegate void WorkDoneEventHandler(int completedWork);

   public void DoWork()
   {
     for (int completedWork = 1; completedWork <= 100; completedWork++)
     {
       System.Threading.Thread.Sleep(1000);

       if (WorkDone != null)
       {
         WorkDone(completedWork);
       }
     }
   }
}

Tuesday, December 20, 2011

Getting started with RadDesktopAlert

Problem: Is there any thing in which a pop-up or alert appears from the bottom of screen.
Solution: Telerik has a solution for this,use RadDesktopAlert.

To see video Click the following link.
http://tv.telerik.com/watch/winforms/getting-started-with-raddesktopalert

How to disable filter button in RadGridView in Winforms

Problem: I am setting the properties of RadGridView in Winforms like Header of column and filter to disable but they are not working.
Solution: This is a bug in current version of Telerik. and hope it iwll be resolved in next version but you can do this by coding.
for example:
VB Code:
RadGridView1.MasterTemplate.AllowDeleteRow = False
RadGridView1.MasterTemplate.AllowEditRow = False
RadGridView1.MasterTemplate.AllowAddNewRow = False
RadGridView1.MasterTemplate.EnableGrouping = False
RadGridView1.MasterTemplate.ShowRowHeaderColumn = False
C# Code:
RadGridView1.MasterTemplate.AllowDeleteRow = false;
RadGridView1.MasterTemplate.AllowEditRow = false;
RadGridView1.MasterTemplate.AllowAddNewRow = false;
RadGridView1.MasterTemplate.EnableGrouping = false;
RadGridView1.MasterTemplate.ShowRowHeaderColumn = false;

Thursday, December 15, 2011

How to show Desktop Alert (RadDesktopAlert)

Problem: How to show desktop alert or a pop-up in desktop which comes from the bottom of screen.
Solution: Drag and drop RadDesktopAlert control from toolbox.It will appear in bottom of form.

You can set its properties from the properties window and see its preview.
Now the code is really simple, I am using a simple button to demonstrate it.Desktop alert is shown at the OnClick event of this button.

VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        RadDesktopAlert1.ContentText = "Hello World"
        RadDesktopAlert1.Show()

End Sub