How to export Gridview data to Excel using devexpress XtraGrid

To export Gridview data to Excel using devexpress XtraGrid have a look at the sample below.

Samples

C# Sample

VB.NET Sample

If you have any questions or suggestions feel free to rate this snippet, post a comment or Contact Us via Email.

Related links:

Please rate this snippet

How to hide the status bar while Splashscreen is Shown in IOS

To hide the status bar while Splashscreen is Shown in IOS follow these Steps.

  • 1. Open the Info.plist File.
  • 2. Search for the “Status bar is initially hidden” property and set it to checked.
  • if you do not have the “Status bar is initially hidden” property, simply add it by selecting the last line in the File and then click the plus button on the right end of the line.

    To show the status bar you can use this snippet.

    [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone]; //UIStatusBarAnimationNone, UIStatusBarAnimationFade or UIStatusBarAnimationSlide
    

    Please rate this snippet

    How to show software keyboard when focusing textedit in Android

    To show software keyboard when focusing textedit in Android you can use the snippet below.

    Sample Java

    myTextEdit.setOnFocusChangeListener(new View.OnFocusChangeListener() {
        @Override
        public void onFocusChange(View view, boolean focus) {
            if (focus) {
                dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
            }
        }
    });
    

    Please rate this snippet

    How to hide a Console Window in C# and VB.NET

    To hide a Console Window in C# and VB.NET you can use the following snippet.

    Sample C#

    public static class Consoles
    {
    	[DllImport("user32.dll")]
    	public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
    
    	[DllImport("user32.dll")]
    	public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
    
    	public static void SetConsoleWindowVisibility(bool visible, IntPtr hWnd)
    	{
    		ShowWindow(hWnd, !visible ? 0 : 1);
    	}
    }
    

    usage:

    var hWnd = Consoles.FindWindow(null, Console.Title);
    Consoles.SetConsoleWindowVisibility(false, hWnd);
    

    Sample VB.NET

    Public NotInheritable Class Consoles
    	Private Sub New()
    	End Sub
    	<DllImport("user32.dll")> _
    	Public Shared Function FindWindow(lpClassName As String, lpWindowName As String) As IntPtr
    	End Function
    
    	<DllImport("user32.dll")> _
    	Public Shared Function ShowWindow(hWnd As IntPtr, nCmdShow As Integer) As Boolean
    	End Function
    
    	Public Shared Sub SetConsoleWindowVisibility(visible As Boolean, hWnd As IntPtr)
    		ShowWindow(hWnd, If(Not visible, 0, 1))
    	End Sub
    End Class
    

    usage:

    Dim hWnd = Consoles.FindWindow(Nothing, Console.Title)
    Consoles.SetConsoleWindowVisibility(False, hWnd)
    

    Please rate this snippet