DataGridView designing layout with datasource

Hello,
1) I created a DataSet with several columns.
2) I have bound this DataSet as DataSource on a DataGridView.
3) I have set the only table in my DataSet as DataMember.
Now my DataGridView shows the columns in this table, and this works perfectly fine. I can change the properties/style of each column (text font, background color, columns width, etc.)
But the problem is, when I unbind my DataSource (by accident or on purpose), and then I bind it again, ALL of my settings to these columns are completely gone, and I have to redo them all.
Is there a way to handle this? Or is this just the way it works?
Thanks for reading my question.
Best Regards, Sam
Do not fear... Cus we C-sharp here!

Sam,
It works that way because you're basically auto-generating the columns when you bind your DataSet as the grid's DataSource. Once you unbind, the grid doesn't know what happened to those columns, so all the settings go away.
To avoid that, you have two options:
1) You can put all the code you're already doing for setting up the columns in one method, and call that method every time you rebind the grid.
2) You can add the grid's columns manually, either in the Designer or programmatically.
~~Bonnie DeWitt [C# MVP]
http://geek-goddess-bonnie.blogspot.com

Similar Messages

  • Best practice creating an Corporate Design (Layout) with a web dynpro

    I got now a dynpro application that has the functionality of my wishes.
    but how to create a corporate design (layout) for my customer?
    i heared that there is a special protal editor for making layouts?
    do you know a best practice? or is it best to work witch the dynpro explorer itself?

    Hi,
    if the application parameter WDTHEMEROOT is not availiable together with the other application parameters in the Workbench, then you might have a lower support package...
    For the style sheet editor you need a portal installation, it belongs to the portal. There's no ABAP transaction for that or ABAP only style sheet editor.
    Regards, Heidi
    PS: See also CSS for WebDynpro ABAP without Portal
    Message was edited by:
            Heidi von Geisau

  • The background behind my pages has turned black, how do i get it to go back to grey? i have switched between preview, normal, bleed, slug and presentation and closed and opened in design and it is still black. I can't imagine layouts with the black backgr

    the background behind my pages has turned black, how do i get it to go back to grey? i have switched between preview, normal, bleed, slug and presentation and closed and opened in design and it is still black. I can't imagine layouts with the black background please help!

    or maybe the interface has been set to Dark?
    Go to Preferences > Interface tab, choose Light from Color Theme dropdown on Apearance section (upper part of the window)

  • Is MS Word really the best Oracle can come with for designing layouts?

    Hi all,
    I am returning to XMLP development after first looking at it two years ago. Back then I advised our company not to use it for all report development as MS Word didn't seem robust or flexible enough to generate report layouts.
    Now I am working for a client that wants to use XMLP and am trying to develop a fairly simple tabular report but with about 5 levels of grouping. The resulting RTF template therefore has 5 levels of nested tables. Whilst all the data is coming out fine, I am finding it very hard to make the layout look anything like as within Word it is hard to select table cells, visually establish the heirachy of the tables, etc. A simple task like putting the correct borders around cells so they render correctly is very hard to get right. In addition to this I have a number of areas where erroneous white space is being displayed.
    Is Oracle seriously going to continue to expect developers to use MS Word as a layout designer or are they going to develop a decent product fit for the task? I am tired of hearing from sales guys, functional consultants and Oracle blurb how easy XMLP is to develop reports in. Yes, it is if the report is simple, but try and develop a more complex layout and it is anything but simple.
    Anyone got any advice or experience they can share? Are there any alternative tools on the market? A response from Oracle wouldn't go a miss to help stem my disappointment with both product and company!
    Cheers,
    Jon.

    Hi Guys,
    forgive me, that I am biased - I am responsible for the BI Publisher tool development.
    First one comment regarding the nested table - The code we generate for that is the worst part of the template builder. We already have implemented a new version, which is much better - to be released after 10.1.3.4. I apologize for us not fixing that issue earlier.
    Yes, the BI Publisher template builder for Word is different. Naturally it is better for some tasks and maybe weaker for some other ones. Nobody forced the E-Business Suite teams to take up BI/XML Publisher - I was PM in one of the teams so I know for sure - we all decided that we rather use BI Publisher. In our eyes it is a step forward and not 10 steps back.
    I was product manager for Oracle Contracts. We tried to create a contract layout with Oracle Reports and it was not pretty. Sure If I create just some data reports all the classical reporting tools are fine (Do you really like these other tools???)
    But creating contracts or more business style reports like invoices is MUCH easier with BI Publisher. With the first generation of the tools, it took my 2 hours to convert a customer contract example (in word naturally) into a production ready contract layout. Now, I could probably do it in 15 minutes.
    While PL/SQL has great acceptance in the Oracle Community, it is not everyone's favorite - for example Peoplesoft, JD Edwards or Siebel developers can not use PL/SQL.
    XSL has its quicks and wish it was a better language, but it is an OPEN standard.
    We have migrated about 3000 Oracle reports, and all of the Peoplesoft and JD Edwards reports... I don't think it is a toy. It has the same concept as Java Server Pages and it uses Word for formatting instead of HTML.
    True, knowing SQL does not help with BI Publisher reports, but user with a little SQL knowledge can do havoc to a production system. BI Publisher complete separates the responsibilities. SQL for professionals and Word for formatting. I think there are more people out there that know Word than SQL.
    Embedding the XSL did not turn out all that straight forward. We are also missing one feature in the standalone, that we had in E-Business Suite and that will be included in the 11g release: Subtemplates.
    Subtemplates allow you to write complicated XSL libraries that can be called from within RTF templates. For all of you who need to write complicated logic, it is much better to write the logic into an XSL stylesheet and just call out from within the Word template than coding to complicated logic into the Word document. Again my apologies for us not providing this option earlier.
    People also had to learn java for Oracle applications, when they only needed to know PL/SQL before.
    For all the people who don't like Microsoft Word, we are offering a web based alternative shortly after the 10.1.3.4 release. This tool may be better suited for data style reports - you will be the judge.
    I appreciate your feedback and I open for any suggested improvements.
    Thanks,
    Klaus
    Message was edited by:
    KlausFabian

  • SharePoint Designer 2013 with SOAP DataSource and Windows Authentication

    Hello
    What do I need to do to create a SOAP Data Source in SharePoint Designer 2013 with Windows Authentication?
    I am trying to display a list from another subsite in my Web Part Page using a DataView web part.
    My environment is set up to use Claims with Kerberos.
    Is there a guide available that talks about configuring this or troubleshooting this? What should I check?
    Thanks for any suggestions.
    Yoshi

    Hi,
    According to your post, my understanding is that you wanted to create a SOAP Data Source in SharePoint Designer 2013.
    Please refer to the official article related, although it is about the SharePoint Designer 2010, it still works for SharePoint Designer 2013.
    http://office.microsoft.com/en-in/sharepoint-designer-help/add-a-soap-service-as-a-data-source-HA010355752.aspx
    More information:
    http://social.technet.microsoft.com/Forums/en-US/20e34a68-fa78-4450-9744-45f9e3ff26b5/sharepoint-designer-soap-and-rest-datasource-failure?forum=sharepointcustomizationprevious
    http://sharepointdiva.wordpress.com/2012/03/19/create-cross-site-data-source/
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Applet does not load on app server when Free Design Layout

    Hi,
    I have to embed a an applet in a webpage of an web application. Before I go on to anything.. let me first tell you, I am using Netbeans 6.0
    As shown in the tuorial:
    [http://www.netbeans.org/kb/articles/tutorial-applets-40.html]
    1. I first made the "Applet" source say HelloApplet. java. After compiling and running it I get the HelloApplet.jar.
    2. I created a WebApplication and then from the properties -> packaging -> I "Add Project" HelloApplet.jar.
    3. Then I a webpage I "embeded" the applet.
    4. I run the web app and the applet gets loaded and everything is just fine.
    But before I go on I must tell you that the applet was designed in Null Layout. Now I edited the applet source once again and changed the layout to Free Design Layout*. ( this is available from Netbeans..on the HelloApplet.java .. go to the design view.. right click on the form and from the context menu you can change the layout to FreeDesign or whatever you might want).
    When I expand the "Libraries" node I see the that the library Swing Layout Extensions - swing-layout-1.0.3.jar has been added.
    When I "run" the "HelloApplet.java" file, the applet is shown in the appletviewer. No problems with that.
    But!
    When I try to Clean & Build and Run the WebApplication, the applet does not get loaded. On inspecting the java console I see the following error:
    java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at sun.applet.AppletPanel.createApplet(Unknown Source)
    at sun.plugin.AppletViewer.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: org.jdesktop.layout.GroupLayout$Group
    at sun.applet.AppletClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    ... 10 moreIt clearly shows that the Free Design Layout has something to do with the GroupLayout which can be found by expanding the "Swing Layout Extensions - swing-layout-1.0.3.jar". Now when the HelloApplet.jar is created only the HelloApplet.class file gets included together with some other data but NOT the swing extensions. Hence when I run the web app the class file looks for the GroupLayout.class definition but can find it in the jar as its not included when the HelloApplet.jar is created.
    But with null layout there isint a problem because null layout takes the definitions from the JRE on the machine.. and so it runs without a hitch.
    My Question is : How can I run the applet with Free Design Layout? or is it possible to package the swing layout extensions in the HelloApplet.jar?<</u>
    Thanks for all your replies.
    Cheers.
    Edited by: arijit_datta on May 15, 2008 4:07 PM

    Solved.
    Here is the solution:
    [http://www.nabble.com/Applet-does-not-load-on-app-server-when-Free-Design-Layout-to17259115.html|http://www.nabble.com/Applet-does-not-load-on-app-server-when-Free-Design-Layout-to17259115.html]
    Cheers..
    Edited by: arijit_datta on May 16, 2008 7:41 AM

  • Report Designer - Layout height and width

    Hi Experts,
    Is there an option to adjust the report designer layout height and width? I am able to adjust the individual row and column height. I have a report designed in report designer which will have only 5 rows. when I execute this web template the report item is displayed in one entire page instead of only 5 rows.
    How can I control/adjust the page size in report designer? Is this possible?
    Thanks,
    Gnana

    Gnana,
    are you starting the report from the portal directly, or do you have it embedded into a web template?  As the Report is a web item, you can set the size of the item.
    At first I was considering posting the reports directly to the portal, but there are some things that I don't like with how it handles them - for example if you have a report based on the query view, when you post it directly to the portal it will execute it with the saved variable values before you can change them.  Thus, I have to put it into a web template and set to prompt for variables at the beginning.
    Thanks

  • Tables associated with DataSource!

    Hi friends! i am trying to create an ODS for Delta which extrac data from Infosource 0CO_0M_OPA_6 (actual). while creating ODS, i have to gives key fields. The problem is that i dont know what are the key fields. we can find out the key fields if we know the name of the tables by going to se11. but i dont know what are the tables DataSource 0CO_0M_OPA_6 extract data from. could some one tell me how to find out the tables connected to specif datasource to find out the key fields to be put in ODS?

    Manmit
    Actually we will assign Keyfields and data fields depends on our design not with the tables. For example in your report controlling area and document number are the keys you assign them to key fields.
    Please check this Data Model for 0CO_0M_OPA_6
    http://help.sap.com/saphelp_nw04/helpdata/en/41/5d52386bc52f1ae10000000a114b54/frameset.htm
    Please check this document to identify the tables for the Datasource
    http://help.sap.com/saphelp_nw04/helpdata/en/86/b35a259a03fe42b29d1437a7fba1c6/frameset.htm
    Hope this helps
    Thnaks
    Sat

  • How to use 2 different layouts with media query

    I want to do my site for multiple devices. BUT some sections of the full page I do not want to use in the smartphone version. Responsive design changes the appearence of layout with CSS, but the elements are the same. Any idea?
    Thanks in advance

    Mobile browsers will see the mobile image.
    Desktop browsers will see the desktop image.
    See example below. 
    http://alt-web.com/FluidGrid/Fluid-4.html
    Nancy O.

  • How to pull the data into smartform after designing layout?

    how to pull the data into smartform after designing layout?

    call the smartform in your Driver program and pass your output internal tables in the smartforms paramaters
    Check the below Sample code.
    FORM label_print.
      DATA : g_fm_name TYPE rs38l_fnam,
             g_output  TYPE ssfcompop,
             g_control TYPE ssfctrlop,
             g_form TYPE tdsfname VALUE 'ZPRINT_LABELS',
             g_dest TYPE rspopname,
             g_printer TYPE rspoptype..
      REFRESH : i_out[],i_qals[].
      SELECT matnr maktx
             INTO TABLE i_out
             FROM makt
             FOR ALL ENTRIES IN i_mseg
             WHERE matnr = i_mseg-matnr
             AND   spras = sy-langu.
      SELECT prueflos objnr ersteldat erstelzeit matnr revlv charg mengeneinh
             INTO TABLE i_qals
             FROM qals
             FOR ALL ENTRIES IN i_mseg
             WHERE matnr = i_mseg-matnr
             AND   charg = i_mseg-charg.
    *FM to accept the device type and returns the short name of the output device
      CALL FUNCTION 'EFG_GET_PRINTER'
        EXPORTING
          x_no_dialog  = ' '
          x_obligatory = 'X'
        IMPORTING
          y_tddest     = g_dest
        EXCEPTIONS
          cancelled    = 1
          failed       = 2
          OTHERS       = 3.
    *device type name for the output device
      SELECT SINGLE patype                                  "#EC CI_NOFIELD
             FROM tsp03d
             INTO g_printer
             WHERE padest = g_dest.
    *printer setting
      g_control-no_dialog = 'X'.
      g_output-tdarmod = '1'.
      g_output-tdcopies = '001'.
      g_output-tddest = g_dest.
      g_output-tdprinter = g_printer.
      g_output-tdnewid = 'X'.
      g_output-tdimmed = 'X'.
      CLEAR wa_mseg.
      LOOP AT i_mseg INTO wa_mseg.
        READ TABLE i_out INTO wa_out WITH KEY matnr = wa_mseg-matnr.
    check for the status and filter the records
        CLEAR : wa_qals.
        LOOP AT i_qals INTO wa_qals WHERE matnr = wa_mseg-matnr
                                    AND charg = wa_mseg-charg.
          CALL FUNCTION 'STATUS_TEXT_EDIT'
            EXPORTING
              objnr            = wa_qals-objnr
              spras            = sy-langu
            IMPORTING
              line             = l_status
            EXCEPTIONS
              object_not_found = 1
              OTHERS           = 2.
          IF l_status CS 'LTCA' OR l_status CS 'SKIP'.
            DELETE i_qals.
          ENDIF.
        ENDLOOP.
        SORT i_qals BY ersteldat DESCENDING erstelzeit DESCENDING.
        IF i_qals IS INITIAL.
          l_msg = text-002.
        ELSE.
          READ TABLE i_qals INTO wa_qals INDEX 1.
          SELECT prueflos vbewertung
                 INTO TABLE i_qave
                 FROM qave
                 WHERE prueflos = wa_qals-prueflos
                 AND   kzart = 'L'.
          IF sy-subrc <> 0.
            l_msg1 = text-003.
          ENDIF.
          SORT i_qave.
          CLEAR : wa_qave.
          IF NOT i_qave IS INITIAL.
            READ TABLE i_qave INTO wa_qave INDEX 1.
            IF wa_qave-vbewertung = 'A'.
              l_msg = text-002.
            ELSEIF wa_qave-vbewertung = 'R'.
              l_msg1 = text-003.
            ELSE.
              l_msg1 = text-003.
            ENDIF.
          ENDIF.
        ENDIF.
        CLEAR : wa_ser03.
        READ TABLE i_ser03 INTO wa_ser03 WITH KEY mblnr = wa_mseg-mblnr.
    *Calling Smartform
        CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
          EXPORTING
            formname           = g_form
          IMPORTING
            fm_name            = g_fm_name
          EXCEPTIONS
            no_form            = 1
            no_function_module = 2
            OTHERS             = 3.
        LOOP AT i_objk INTO wa_objk WHERE obknr = wa_ser03-obknr.
    *Calling FM generated from the smartform
          DATA : l_date(10) TYPE c,
                 l_date1(10) TYPE c,
                 l_date2(10) TYPE c,
                 l_date3(10) TYPE c,
                 l_hyphen(1) TYPE c VALUE '-'.
          CLEAR : l_date,l_date1,l_date2,l_date3.
          l_date1 = wa_mseg-vfdat+0(4).
          l_date2 = wa_mseg-vfdat+4(2).
          l_date3 = wa_mseg-vfdat+6(2).
          CONCATENATE l_date1 l_hyphen l_date2 l_hyphen l_date3 INTO l_date.
          CALL FUNCTION g_fm_name
            EXPORTING
              control_parameters = g_control
              output_options     = g_output
              user_settings      = ' '
              g_matnr            = wa_mseg-matnr
              g_mat_text         = wa_out-maktx
              g_batch            = wa_mseg-charg
              g_rev              = wa_qals-revlv
              g_edate            = l_date
              g_lot              = wa_qals-prueflos
              g_qty              = wa_mseg-erfmg
              g_uom              = wa_mseg-erfme
              g_serial           = wa_objk-sernr
              g_smsg             = l_msg
              g_fmsg             = l_msg1
            EXCEPTIONS
              formatting_error   = 1
              internal_error     = 2
              send_error         = 3
              user_canceled      = 4
              OTHERS             = 5.
          CLEAR  g_output-tdnewid.
        ENDLOOP.
        IF sy-subrc <> 0.
          CLEAR : l_date,l_date1,l_date2,l_date3.
          l_date1 = wa_mseg-vfdat+0(4).
          l_date2 = wa_mseg-vfdat+4(2).
          l_date3 = wa_mseg-vfdat+6(2).
          CONCATENATE l_date1 l_hyphen l_date2 l_hyphen l_date3 INTO l_date.
          CALL FUNCTION g_fm_name
            EXPORTING
              control_parameters = g_control
              output_options     = g_output
              user_settings      = ' '
              g_matnr            = wa_mseg-matnr
              g_mat_text         = wa_out-maktx
              g_batch            = wa_mseg-charg
              g_rev              = wa_qals-revlv
              g_edate            = l_date
              g_lot              = wa_qals-prueflos
              g_qty              = wa_mseg-erfmg
              g_uom              = wa_mseg-erfme
              g_serial           = wa_objk-sernr
              g_smsg             = l_msg
              g_fmsg             = l_msg1
            EXCEPTIONS
              formatting_error   = 1
              internal_error     = 2
              send_error         = 3
              user_canceled      = 4
              OTHERS             = 5.
          CLEAR g_output-tdnewid.
        ENDIF.
      ENDLOOP.
      IF sy-subrc = 0.
        MESSAGE i000(zm).
      ENDIF.
    ENDFORM.                    " label_print

  • Missing Pre-Designed Layouts

    I installed Cloud Suite with CS6 still installed on my system. After trying out CC for a while I uninstalled CS6. When opening DW CC now, there are no pre-designed layouts showing in the new page dialog. It looks like this:
    How can I get the pre-designed layouts back?

    Please refer the thread discussing similar issue.
    http://forums.adobe.com/message/5491936#5491936

  • Design issue with the multiprovider

    Design issue with the multiprovider :
    I have the following problem when using my multiprovider.
    The data flow is like this. I have the info-objects IobjectA, IobjectB, IobjectCin my Cube.(Source for this data is s-systemA)
    And from another s-system I am also loading the masterdata for IobjectA
    Now I have created the multiprovider based on the cube and IobjectA.
    However, surprisingly join in not workign in multiprovider correctly.
    Scenario :
    Record from the Cube.
    IObjectA= 1AAA
    IObjectB = 2BBB
    IObjectC = 3CCC
    Records from IobjectA =1AAA.
    I expect the record should be like this :
    IObjectA : IObjectB: IObjectC
    1AAA       :2BBB       :3CCC
    However, I am getting the record like this:
    IObjectA : IObjectB: IObjectC
    1AAA       :2BBB       :3CCC
    1AAA         : #             :#
    In the Identification section I have selected both the entries for IobjectA still I am getting this error.
    My BW Version is 3.0B and the SP is 31.
    Thanks in advance for your suggestion.

    May be I was not clear enough in my first explanation, Let me try again to explain my scenario:
    My Expectation from Multi Provider is :
    IObjectA
    1AAA
    (From InfoObject)
    Union
    IObjectA     IObjectB     IObjectC
    1AAA     2BBB     3CCC
    (From Cube)
    The record in the multiprovider should be :
    IObjectA     IObjectB     IObjectC
    1AAA     2BBB     3CCC
    Because, this is what the Union says .. and the Definition of the multiprovider also says the same thing :
    http://help.sap.com/saphelp_bw30b/helpdata/EN/ad/6b023b6069d22ee10000000a11402f/frameset.htm
    Do you still think this is how the behaviour of the multiprovider.. if that is the case what would be the purpose of having an infoobject in the multiprovider.
    Thank you very much in advance for your responses.
    Best Regards.,
    Praveen.

  • Line Layout with Reference Key in F-03

    Dear all,
    Iu2019m facing the following problem.
    I modified the line layouts for F-03 through O7Z4S. In particular I created a line layouts with the field Reference key 1. The problem is that in F-03, using this variant, the field XREF1 appeared always blank. The same thing happens for XREF2 while for XREF3  everthing is ok.
    Is something that I forgot in customizing?
    Thanks in advance

    Dear Alberto,
    I created the same - Reference Key in IDES it works if you create with text and then insert Reference key as part of Field with this.
    Hope this would surely help...
    Deven.

  • How do I create a crystal report layout with a table and borders

    My crystal report is a signin sheet. The sign in sheet has an ID column, Name column, Institution column, Place to signin column, and Weekday columns with checkboxes in each column for the visitor to checkoff.
    How do I display the data that is being used int he crystal report in a table layout with borders around each cell? And is it possible to center vertical alignment of the data within eacvh cell like Excel?

    Blahahaha! Great answer Deb!
    Seriously though... There is no vertical alignment in CR. There have been several past threads related to this issue and all of them have various workarounds. None of them are very elegant.
    The best workaround I've found (especially if you are grid or borders) is to turn off the boarders for the field itself and drawl a rectangle around the field(s). Now you can place the field in the lower portion of the rectangle and adjust the rectangles height to place the field text in the center of the rectangle.
    This will give you more control over the height of your elements than using a carriage return before the text.
    Jason

  • How to display 2 layouts with 2 different Header and Footer in a template.

    Hi,
    I am using XML Publisher 5.5. I have created one template which is having two layouts. I am using <?Start: Body?> and <?end body?> for displaying Headers and footers. Now my problem is, I need to display first layout with it's associated Header and footer and then second layout with other header and footer. But the two layouts should come in single template file. How is it possible?. Is there any work around? Please help me as this is the urgent requirement to my client.
    Thanks.
    Siva.

    No problem. Select Insert -> Break from the menu bar. Then select a "Section Break" - Next page.
    Header 1
    <?start:body?>
    Page 1
    <?end: body?>
    Footer 1
    ==================Section Break (Next Page)=================
    Header 2
    <?start:body?>
    Page 2
    <?end: body?>
    Footer 2
    Worked like a charm.
    Klaus

Maybe you are looking for