Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. rtl gridview

rtl gridview

Scheduled Pinned Locked Moved C#
graphicshelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alireza zahani
    wrote on last edited by
    #1

    hi i have Datagridview and i want to print this so my language is Right to left i use Printducument but is dosnt work please help me tanx -----------------

    class PrintDGV
    {
    private static StringFormat StrFormat; // Holds content of a TextBox Cell to write by DrawString
    private static StringFormat StrFormatComboBox; // Holds content of a Boolean Cell to write by DrawImage
    private static Button CellButton; // Holds the Contents of Button Cell
    private static CheckBox CellCheckBox; // Holds the Contents of CheckBox Cell
    private static ComboBox CellComboBox; // Holds the Contents of ComboBox Cell

        private static int TotalWidth;          // Summation of Columns widths
        private static int RowPos;              // Position of currently printing row 
        private static bool NewPage;            // Indicates if a new page reached
        private static int PageNo;              // Number of pages to print
        private static ArrayList Columnlefts = new ArrayList();  // left Coordinate of Columns
        private static ArrayList ColumnWidths = new ArrayList(); // Width of Columns
        private static ArrayList ColumnTypes = new ArrayList();  // DataType of Columns
        private static int CellHeight;          // Height of DataGrid Cell
        private static int RowsPerPage;         // Number of Rows per Page
        private static System.Drawing.Printing.PrintDocument printDoc =
                       new System.Drawing.Printing.PrintDocument();  // PrintDocumnet Object used for printing
    
        private static string PrintTitle = "";  // Header of pages
        private static DataGridView dgv;        // Holds DataGridView Object to print its contents
        private static List SelectedColumns = new List();   // The Columns Selected by user to print.
        private static List AvailableColumns = new List();  // All Columns avaiable in DataGrid 
        private static bool PrintAllRows = true;   // True = print all rows,  False = print selected rows    
        private static bool FitToPageWidth = true; // True = Fits selected columns to page width ,  False = Print columns as showed    
        private static int HeaderHeight = 0;
    
        public static void Print\_DataGridView(DataGridView dgv1)
        {
            PrintPreviewDialog ppvw;
            try 
            {	
                // Getting DataGridView object to print
                dgv = dgv1;
    
    A L 2 Replies Last reply
    0
    • A alireza zahani

      hi i have Datagridview and i want to print this so my language is Right to left i use Printducument but is dosnt work please help me tanx -----------------

      class PrintDGV
      {
      private static StringFormat StrFormat; // Holds content of a TextBox Cell to write by DrawString
      private static StringFormat StrFormatComboBox; // Holds content of a Boolean Cell to write by DrawImage
      private static Button CellButton; // Holds the Contents of Button Cell
      private static CheckBox CellCheckBox; // Holds the Contents of CheckBox Cell
      private static ComboBox CellComboBox; // Holds the Contents of ComboBox Cell

          private static int TotalWidth;          // Summation of Columns widths
          private static int RowPos;              // Position of currently printing row 
          private static bool NewPage;            // Indicates if a new page reached
          private static int PageNo;              // Number of pages to print
          private static ArrayList Columnlefts = new ArrayList();  // left Coordinate of Columns
          private static ArrayList ColumnWidths = new ArrayList(); // Width of Columns
          private static ArrayList ColumnTypes = new ArrayList();  // DataType of Columns
          private static int CellHeight;          // Height of DataGrid Cell
          private static int RowsPerPage;         // Number of Rows per Page
          private static System.Drawing.Printing.PrintDocument printDoc =
                         new System.Drawing.Printing.PrintDocument();  // PrintDocumnet Object used for printing
      
          private static string PrintTitle = "";  // Header of pages
          private static DataGridView dgv;        // Holds DataGridView Object to print its contents
          private static List SelectedColumns = new List();   // The Columns Selected by user to print.
          private static List AvailableColumns = new List();  // All Columns avaiable in DataGrid 
          private static bool PrintAllRows = true;   // True = print all rows,  False = print selected rows    
          private static bool FitToPageWidth = true; // True = Fits selected columns to page width ,  False = Print columns as showed    
          private static int HeaderHeight = 0;
      
          public static void Print\_DataGridView(DataGridView dgv1)
          {
              PrintPreviewDialog ppvw;
              try 
              {	
                  // Getting DataGridView object to print
                  dgv = dgv1;
      
      A Offline
      A Offline
      alireza zahani
      wrote on last edited by
      #2

      please see this http://s6.uplod.ir/i/00477/dxv0r4vn0zbg.png[^]

      B 1 Reply Last reply
      0
      • A alireza zahani

        please see this http://s6.uplod.ir/i/00477/dxv0r4vn0zbg.png[^]

        B Offline
        B Offline
        Blue_Boy
        wrote on last edited by
        #3

        Where is the problem?


        I Love T-SQL "VB.NET is developed with C#.NET" If my post helps you kindly save my time by voting my post.

        1 Reply Last reply
        0
        • A alireza zahani

          hi i have Datagridview and i want to print this so my language is Right to left i use Printducument but is dosnt work please help me tanx -----------------

          class PrintDGV
          {
          private static StringFormat StrFormat; // Holds content of a TextBox Cell to write by DrawString
          private static StringFormat StrFormatComboBox; // Holds content of a Boolean Cell to write by DrawImage
          private static Button CellButton; // Holds the Contents of Button Cell
          private static CheckBox CellCheckBox; // Holds the Contents of CheckBox Cell
          private static ComboBox CellComboBox; // Holds the Contents of ComboBox Cell

              private static int TotalWidth;          // Summation of Columns widths
              private static int RowPos;              // Position of currently printing row 
              private static bool NewPage;            // Indicates if a new page reached
              private static int PageNo;              // Number of pages to print
              private static ArrayList Columnlefts = new ArrayList();  // left Coordinate of Columns
              private static ArrayList ColumnWidths = new ArrayList(); // Width of Columns
              private static ArrayList ColumnTypes = new ArrayList();  // DataType of Columns
              private static int CellHeight;          // Height of DataGrid Cell
              private static int RowsPerPage;         // Number of Rows per Page
              private static System.Drawing.Printing.PrintDocument printDoc =
                             new System.Drawing.Printing.PrintDocument();  // PrintDocumnet Object used for printing
          
              private static string PrintTitle = "";  // Header of pages
              private static DataGridView dgv;        // Holds DataGridView Object to print its contents
              private static List SelectedColumns = new List();   // The Columns Selected by user to print.
              private static List AvailableColumns = new List();  // All Columns avaiable in DataGrid 
              private static bool PrintAllRows = true;   // True = print all rows,  False = print selected rows    
              private static bool FitToPageWidth = true; // True = Fits selected columns to page width ,  False = Print columns as showed    
              private static int HeaderHeight = 0;
          
              public static void Print\_DataGridView(DataGridView dgv1)
              {
                  PrintPreviewDialog ppvw;
                  try 
                  {	
                      // Getting DataGridView object to print
                      dgv = dgv1;
          
          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          "It doesn't work" does not really help. As is, I'd be guessing that the order in which the columns are drawn are the opposite of what you want to achieve. That's simple; reverse the loop that does the drawing.

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups