CN103577047B - The display processing method of HScrollBar and device for DataGrid control - Google Patents

The display processing method of HScrollBar and device for DataGrid control Download PDF

Info

Publication number
CN103577047B
CN103577047B CN201310541265.8A CN201310541265A CN103577047B CN 103577047 B CN103577047 B CN 103577047B CN 201310541265 A CN201310541265 A CN 201310541265A CN 103577047 B CN103577047 B CN 103577047B
Authority
CN
China
Prior art keywords
datagrid control
datagrid
row
control
hscrollbar
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310541265.8A
Other languages
Chinese (zh)
Other versions
CN103577047A (en
Inventor
王月
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201310541265.8A priority Critical patent/CN103577047B/en
Publication of CN103577047A publication Critical patent/CN103577047A/en
Application granted granted Critical
Publication of CN103577047B publication Critical patent/CN103577047B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Storage Device Security (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses display processing method and the device of a kind of HScrollBar for DataGrid control.The display processing method of this HScrollBar being used for DataGrid control includes: obtain the null in DataGrid control, wherein, in data for there is null time empty in DataGrid control, null includes container, and the col width summation of the overall width of null row all with DataGrid control is consistent;When data at DataGrid control are empty, obtain the col width summation of all row in DataGrid control by null;And show HScrollBar according to the col width summation of row all in DataGrid control.Pass through the present invention, solve in correlation technique when no data, DataGrid control cannot show that horizontal scroll bar, to check the problem of all of row, and then has reached not directly displayed HScrollBar to check the effect of all row in DataGrid control by limiting with presence or absence of data.

Description

The display processing method of HScrollBar and device for DataGrid control
Technical field
The present invention relates to internet arena, in particular to a kind of HScrollBar for DataGrid control Display processing method and device.
Background technology
Windows presentation foundation (Windows Presentation Foundation is called for short WPF) is a new generation of Microsoft figure System, can generate the window client application program with shock visual experience.
WPF carries data grids (DataGrid) control, and this DataGrid control uses in application development The most frequently.In the related, various data can be shown between row and column neatly by DataGrid control, When data are more complicated, it is accomplished by using a lot of data to arrange by DataGrid control exposure data, and by software The restriction of interface width, when data columns is too much, needs to use horizontal scroll bar, so, Yong Huke on interface To check that all of data arrange by dragging horizontal scroll bar, but, when no data in DataGrid control, In correlation technique, it is impossible to display horizontal scroll bar is to check all of row.
For in correlation technique when no data DataGrid control cannot show that horizontal scroll bar is to check all of row Problem, the most not yet proposes effective solution.
Summary of the invention
Present invention is primarily targeted at the display processing method that a kind of HScrollBar for DataGrid control is provided And device, to solve in correlation technique in DataGrid control during no data, user cannot not show fixing control Under conditions of check the problem of current all row.
To achieve these goals, according to an aspect of the invention, it is provided a kind of water for DataGrid control The display processing method of flat scroll bar.The method includes: obtain the null in DataGrid control, wherein, data network In data for there is null time empty in lattice control, null includes container, the overall width of null and institute in DataGrid control The col width summation having row is consistent;When data at DataGrid control are empty, obtained in DataGrid control by null The col width summation of all row;And show HScrollBar according to the col width summation of row all in DataGrid control.
Further, obtain the col width summation of all row in described DataGrid control by null to include: obtain data Current data content in Net Lattice Controls;Obtain the parent data content of current data content;The width of container is bound To the parent data content self-defining line width attribute of current data content, line width attribute is used for obtaining data grids The col width summation of all row in control;And it is total to obtain the col width of all row in DataGrid control by line width attribute With.
Further, self-defining line width attribute obtains in the following manner: in the data at DataGrid control place Total col width is calculated in content;And total col width is assigned to self-defining line width attribute.
Further, before the col width summation according to row all in DataGrid control shows HScrollBar, this shows Show that processing method also includes: load data source for DataGrid control.
Further, before loading data source for DataGrid control, this display processing method also includes: judge number Whether the data source according to Net Lattice Controls is empty;If the data source of DataGrid control is not empty, do not process;As Really the data source of DataGrid control is empty, then the attribute that can the user of DataGrid control add newline is set to Very;And after the attribute that the user of DataGrid control can add newline is set to very, by data grids control The line width of part is entered as the line width of described null.
To achieve these goals, according to a further aspect in the invention, it is provided that a kind of water for DataGrid control The display processing unit of flat scroll bar.This device includes: the first acquiring unit, is used for obtaining in DataGrid control Null, wherein, in data for there is null time empty in DataGrid control, null includes container, the beam overall of null The col width summation spending row all with DataGrid control is consistent;Second acquisition unit, at DataGrid control When data are empty, obtain the col width summation of all row in DataGrid control by null;And display unit, it is used for Col width summation display HScrollBar according to row all in DataGrid control.
Further, second acquisition unit includes: the first acquisition module, current for obtain in DataGrid control Data content;Second acquisition module, for obtaining the parent data content of current data content;Binding module, is used for The width of container is tied to the parent data content self-defining line width attribute of current data content, line width attribute For obtaining the col width summation of all row in DataGrid control;And the 3rd acquisition module, for by line width attribute Obtain the col width summation of all row in DataGrid control.
Further, in order to obtain described self-defining line width attribute, second acquisition unit also includes: calculate mould Block, for calculating described total col width on the data content at DataGrid control place;And assignment module, it is used for By total col width be assigned to self-defining line width attribute.
Further, device also includes: loading unit, for total at the col width according to row all in DataGrid control Before display HScrollBar, load data source for DataGrid control.
Further, this device also includes: judging unit, for judging that whether the data source of DataGrid control is Empty;Processing unit, if the data source for DataGrid control is not empty, does not processes;Unit is set, uses If the data source in DataGrid control is empty, then the attribute that can the user of DataGrid control add newline sets It is set to true;And assignment unit, for being set to very at the attribute that can the user of DataGrid control be added newline Afterwards, the line width of DataGrid control is entered as the line width of null.
By the present invention, using the null obtained in DataGrid control, wherein, DataGrid control is empty in data Time there is null, null includes container, the col width summation one of all row in the overall width of null and DataGrid control Cause;When data at DataGrid control are empty, obtain the col width of all row in DataGrid control by null total With;And show HScrollBar according to the col width summation of row all in DataGrid control, solve in correlation technique When no data, DataGrid control cannot show that horizontal scroll bar, to check the problem of all of row, and then reaches HScrollBar is not directly displayed to check the effect of all row in DataGrid control by limiting with presence or absence of data.
Accompanying drawing explanation
The accompanying drawing of the part constituting the application is used for providing a further understanding of the present invention, and the present invention's is schematic real Execute example and illustrate for explaining the present invention, being not intended that inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is the display processing unit of the HScrollBar for DataGrid control according to a first embodiment of the present invention Schematic diagram;
Fig. 2 is the display processing unit of the HScrollBar for DataGrid control according to a second embodiment of the present invention Schematic diagram;
Fig. 3 is the display processing unit of the HScrollBar for DataGrid control according to a third embodiment of the present invention Schematic diagram;
Fig. 4 is the display processing unit of the HScrollBar for DataGrid control according to a fourth embodiment of the present invention Schematic diagram;
Fig. 5 is the display processing unit of the HScrollBar for DataGrid control according to a fifth embodiment of the present invention Schematic diagram;
Fig. 6 is the display processing method of the HScrollBar for DataGrid control according to a first embodiment of the present invention Flow chart;
Fig. 7 is the display processing method of the HScrollBar for DataGrid control according to a second embodiment of the present invention Flow chart;And
Fig. 8 is the display processing method of the HScrollBar for DataGrid control according to a third embodiment of the present invention Flow chart.
Detailed description of the invention
It should be noted that in the case of not conflicting, the embodiment in the application and the feature in embodiment can phases Combination mutually.Describe the present invention below with reference to the accompanying drawings and in conjunction with the embodiments in detail.
In order to make those skilled in the art be better understood from the present invention program, below in conjunction with in the embodiment of the present invention Accompanying drawing, to being clearly and completely described in the embodiment of the present invention, it is clear that described embodiment is only this The embodiment of an invention part rather than whole embodiments.Based on the embodiment in the present invention, common in this area Technical staff does not make the every other embodiment obtained under creative work premise, all should belong to the present invention's Protection domain.
It should be noted that term " first " in description and claims of this specification and above-mentioned accompanying drawing, " second " etc. are for distinguishing similar object, without being used for describing specific order or precedence.Should manage Solve the data so used can exchange in the appropriate case, in order to embodiments of the invention described herein can be to remove Order beyond those that here illustrate or describe is implemented.Additionally, term " includes " and " having " and he Any deformation, it is intended that cover non-exclusive comprising.
According to embodiments of the invention, it is provided that the display of a kind of HScrollBar for DataGrid control processes dress Putting, this is used for the display processing unit of HScrollBar of DataGrid control for showing that HScrollBar is to check Having the information of row, wherein it is desired to explanation, the display of this HScrollBar being used for DataGrid control processes dress Put and do not had no data to have by current data Net Lattice Controls to be affected when showing HScrollBar.
Fig. 1 is the display processing unit of the HScrollBar for DataGrid control according to a first embodiment of the present invention Schematic diagram.
As it is shown in figure 1, this device includes: the first acquiring unit 10, second acquisition unit 20 and display unit 30.
First acquiring unit 10 is for obtaining the null in DataGrid control.In embodiments of the present invention, data network Lattice control can be the DataGrid control in WPF, and this DataGrid control exists in advance when data are empty The null set, and the whether visible attribute of the row pattern of this null is preset as invisible, so, when in this null During middle loading data, the data being loaded do not appear in the relevant position of DataGrid control.It addition, DataGrid control In part, data are that sky refers to do not have data in DataGrid control.It should be noted that in embodiments of the present invention, empty Row includes a container, and the overall width of container is the overall width of null.The overall width of null can be with data grids In control, the col width summation of all row is consistent, or the overall width of null can be more than all row in DataGrid control Col width summation, or the overall width of null can be less than the col width summation of all row in DataGrid control.
Second acquisition unit 20 is for when the data of DataGrid control are empty, obtaining data grids control by null The col width summation of all row in part.Specifically, in embodiment of the present invention, second acquisition unit 20 can pass through The overall width of null obtains the col width summation of all row in DataGrid control, it should be noted that second acquisition unit The 20 DataGrid control col width summations that can get the overall width equal to null, second acquisition unit 20 can also Getting the DataGrid control col width summation of the overall width more than null, second acquisition unit 20 can also get Less than the DataGrid control col width summation of the overall width of null, wherein, when the col width of each row is equal, all row Col width summation equal to the product of col width and the columns of single row;When the col width of each row is unequal, the row of all row Wide summation is equal to the cumulative sum of the col width of each row.
Display unit 30 shows HScrollBar for the col width summation according to row all in DataGrid control.At this In inventive embodiments, specifically, when in the DataGrid control that second acquisition unit 20 obtains the col width of all row total With time equal with the overall width of null, then display unit 30 can show that HScrollBar is to search DataGrid control just All column informations in part;When in the DataGrid control that second acquisition unit 20 obtains, the col width summation of all row is more than When the overall width of null is equal, then display unit 30 can show that HScrollBar is to search part in DataGrid control Column information or display unit 30 can not show HScrollBar;When the DataGrid control that second acquisition unit 20 obtains When in part, the col width summation of all row is less than the overall width of null, then display unit 30 can not only show HScrollBar To search all column informations in DataGrid control, moreover it is possible to display is not belonging to other parts of column information.
By the present invention, use the null that the first acquiring unit 10 obtains in DataGrid control;Second acquisition unit 20 when the data of DataGrid control are empty, obtain the col width of all row in DataGrid control by null total With;And display unit 30 shows HScrollBar according to the col width summation of row all in DataGrid control, solve In correlation technique when no data, DataGrid control cannot show that horizontal scroll bar is to check asking of current all row Topic, and then reached not directly displayed HScrollBar to check institute in DataGrid control by limiting with presence or absence of data There is the effect of row.
Fig. 2 is the display processing unit of the HScrollBar for DataGrid control according to a second embodiment of the present invention Schematic diagram.
As in figure 2 it is shown, this embodiment can be as the preferred embodiment of embodiment illustrated in fig. 1, the use of this embodiment Display processing unit in the HScrollBar of DataGrid control include first embodiment the first acquiring unit 10, Second acquisition unit 20 and display unit 30, wherein, second acquisition unit 20 include the first acquisition module 201, Two acquisition modules 202, binding module 203 and the 3rd acquisition module 204.
First acquiring unit 10 is identical with first embodiment with the effect of display unit 30, does not repeats them here.
First acquisition module 201 is for obtaining the current data content in DataGrid control.It should be noted that In the embodiment of the present invention, if the row in DataGrid control is as a class, then each row of row are exactly in such One object, and the corresponding field in such of each row, so, current data content is data grids control The data content of the every a line in part.
Second acquisition module 202 is for obtaining the parent data content of current data content.It should be noted that at this In inventive embodiments, if DataGrid control is as a class, then the every a line in DataGrid control is exactly such In an object, and the corresponding field in such of every a line, so, parent data content is data network The data content at lattice control place, the second acquisition module 202 may be used for obtaining the DataGrid control place at row place Data content, row here can be null.
Binding module 203 for being tied to the self-defining row of parent data content of current data content by the width of container Width attribute, i.e. binding module 20 may be used for the width of container being tied to the DataGrid control at row place certainly The line width attribute of definition, wherein, container is the container of null, and the row pattern of null corresponding to container is visible Whether attribute is preset as invisible, and so, when loading data in this embodiment, the data being loaded do not appear in The relevant position of DataGrid control, line width attribute includes the overall width of row set in advance, and this line width attribute is used In obtaining the col width summation of all row in DataGrid control, so, binding module 203 may be used for the width of null Degree is tied on the DataGrid control self-defining line width attribute at null place.
It should be noted that in embodiments of the present invention, can only be obtained by the first acquisition module 201 or second Module 202 obtains self-defining line width attribute, and without using the first acquisition module 201 and second to obtain mould simultaneously Block 202 is to obtain self-defining line width attribute.
3rd acquisition module 204 is for obtaining the col width summation of all row in DataGrid control by line width attribute.? In the embodiment of the present invention, the overall width of the row in line width attribute is equal to the col width summation of all row in DataGrid control.
By the embodiment of the present invention, use binding module 203 that the overall width of null is tied to the col width in line width attribute Summation, it is achieved that the purpose that the col width summation of the overall width of null row all with DataGrid control is equal, reaches Just display HScrollBar is to check the effect of all column informations.
Fig. 3 is the display processing unit of the HScrollBar for DataGrid control according to a third embodiment of the present invention Schematic diagram.
As it is shown on figure 3, this embodiment can be as the preferred embodiment of embodiment illustrated in fig. 2, the use of this embodiment Display processing unit in the HScrollBar of DataGrid control include the second embodiment the first acquiring unit 10, Second acquisition unit 20 and display unit 30, wherein, second acquisition unit 20 is except including the first acquisition module 201, outside the second acquisition module 202, binding module 203 and the 3rd acquisition module 204, computing module is also included 205 and assignment module 206, computing module 205 and assignment module 206 be used for obtaining the self-defining row of DataGrid control Width attribute.
First acquiring unit 10 and display unit 30 and first acquisition module the 201, second acquisition module 202, binding Module 203 is identical with first embodiment with the effect of the 3rd acquisition module 204, does not repeats them here.
Computing module 205 is for calculating total col width on the data content of DataGrid control.Specifically, when each When the col width of row is equal, total col width is equal to the col width of single row and the product of columns;When the col width of each row is unequal Time, total col width is equal to the cumulative sum of the col width of each row.
Assignment module 206 for being assigned to self-defining line width attribute by total col width, i.e. assignment module 206 can be used In calculated for computing module 205 total col width being assigned to the preset value of line width in DataGrid control, wherein, The preset value of line width is line width attribute.
Fig. 4 is the display processing unit of the HScrollBar for DataGrid control according to a fourth embodiment of the present invention Schematic diagram.
As shown in Figure 4, this embodiment can be as the preferred embodiment of embodiment illustrated in fig. 1, the use of this embodiment In the display processing unit of HScrollBar of DataGrid control except including the first acquiring unit of first embodiment 10, outside second acquisition unit 20 and display unit 30, loading unit 40 is also included.
The effect of the first acquiring unit 10, second acquisition unit 20 and display unit 30 and the phase in first embodiment With, do not repeat them here.
Loading unit 40 is before showing HScrollBar in the col width summation according to row all in DataGrid control Data source is loaded for DataGrid control.Data source refers to provide container or the original media of certain required data, That is, data source is the source of data, can be found the database at data place by data source.In the embodiment of the present invention In, loading unit 40 may be used for DataGrid control and is loaded with the data source of data and the data source of no data.
Fig. 5 is the display processing unit of the HScrollBar for DataGrid control according to a fifth embodiment of the present invention Schematic diagram.
As it is shown in figure 5, this embodiment can be as the preferred embodiment of embodiment illustrated in fig. 4, the use of this embodiment In the display processing unit of HScrollBar of DataGrid control except including the first acquiring unit of the 4th embodiment 10, outside second acquisition unit 20, display unit 30 and loading unit 40, also include judging unit 50, process list Unit 60, unit 70 and assignment unit 80 are set.
The effect of the first acquiring unit 10, second acquisition unit 20, display unit 30 and loading unit 40 is real with first That executes in example is identical, does not repeats them here.
Whether judging unit 50 is empty, wherein, when data source no data for judging the data source of DataGrid control Time, it is judged that it is empty for this data source, otherwise when data source has data, it is judged that be sky for this data source.
If processing unit 60 is not empty for the data source of DataGrid control, do not process.Real in the present invention Execute in example, do not process and refer to DataGrid control not processed.
If arranging unit 70 for the data source of DataGrid control is sky, then by user's energy of DataGrid control The attribute of no interpolation newline is set to very, and so, DataGrid control will add a line null automatically.Need explanation , in embodiments of the present invention, arranging unit 70 can replace with adding device, and this adding device is at sky Row adds meaningless data, and these meaningless data refer to any data, and these the meaningless data in null Do not appear in DataGrid control.
Assignment unit 80 is used for after the attribute that can the user of DataGrid control add newline is set to very, The line width of DataGrid control is entered as the line width of null.
According to embodiments of the invention, it is provided that the display process side of a kind of HScrollBar for DataGrid control Method, this is used for the display processing method of HScrollBar of DataGrid control for showing that HScrollBar is to check Having the information of row, wherein it is desired to explanation, the display of this HScrollBar being used for DataGrid control processes dress Put and do not had no data to have by current data Net Lattice Controls to be affected when showing HScrollBar.This is used for data grids control The display processing method of the HScrollBar of part may operate on computer-processing equipment.It should be noted that this The display processing method of the HScrollBar for DataGrid control that bright embodiment is provided can be real by the present invention The display processing unit for the HScrollBar of DataGrid control executing example performs, being used for of the embodiment of the present invention The display processing unit of the HScrollBar of DataGrid control can be used for perform the embodiment of the present invention for data The display processing method of the HScrollBar of Net Lattice Controls.
Fig. 6 is the display processing method of the HScrollBar for DataGrid control according to a first embodiment of the present invention Flow chart.
As shown in Figure 6, the method includes that steps S101 is to step S103:
Step S101, obtains the null in DataGrid control.
In embodiments of the present invention, DataGrid control can be the DataGrid control in WPF, and should There is null set in advance when data are for sky in DataGrid control, and the whether visible of row pattern of this null belongs to Property be preset as invisible, so, when in this null load data time, the data being loaded do not appear in DataGrid The relevant position of control.It addition, data are that sky refers to do not have data in DataGrid control in DataGrid control.Need Being noted that in embodiments of the present invention, null includes a container, and the overall width of container is the total of null Width.The overall width of null can the col width summation of row all with DataGrid control consistent, or the beam overall of null Degree can be more than the col width summation of all row in DataGrid control, or the overall width of null can be less than data grids The col width summation of all row in control.
Step S102, obtains the col width summation of all row in DataGrid control by null.
Specifically, in embodiment of the present invention, can obtain in DataGrid control all by the overall width of null The col width summation of row, it should be noted that the DataGrid control col width that can get the overall width equal to null is total With, it is also possible to get the DataGrid control col width summation of the overall width more than null, it is also possible to get less than sky The DataGrid control col width summation of the overall width of row, wherein, when the col width of each row is equal, the col width of all row Summation is equal to the col width of single row and the product of columns;When the col width of each row is unequal, the col width summation of all row Cumulative sum equal to the col width of each row.
Step S103, shows HScrollBar according to the col width summation of row all in DataGrid control.
In embodiments of the present invention, specifically, when the col width summation of all row and null in the DataGrid control obtained Overall width equal time, the most just can show that HScrollBar is to search all column informations in DataGrid control;When obtaining When the col width summation of all row is equal more than the overall width of null in the DataGrid control taken, then can show horizontal rolling Bar is with part column information in lookup DataGrid control or can not show HScrollBar;When the DataGrid control obtained When the col width summation of all row is less than the overall width of null in part, then can not only show that HScrollBar is to search All column informations in DataGrid control, moreover it is possible to display is not belonging to other parts of column information.
In embodiments of the present invention, the display processing method of this HScrollBar being used for DataGrid control can also wrap Include and loaded for DataGrid control before the col width summation according to row all in DataGrid control shows HScrollBar Data source.Data source refers to provide container or the original media of certain required data, i.e. data source is data Source, can find the database at data place by data source.In embodiments of the present invention, can be data grids Control is loaded with the data source of data and the data source of no data.
By the present invention, use the null obtained in DataGrid control;When data at DataGrid control are empty, The col width summation of all row in DataGrid control is obtained by null;And according to row all in DataGrid control Col width summation display HScrollBar, solves in correlation technique when no data, and DataGrid control cannot show horizontal stroke To scroll bar to check the problem of all of row, and then reach not by limiting with presence or absence of data and the level that directly displays is rolled Dynamic bar is to check the effect of all row in DataGrid control.
Fig. 7 is the display processing method of the HScrollBar for DataGrid control according to a second embodiment of the present invention Flow chart.
As it is shown in fig. 7, the display processing method of this HScrollBar being used for DataGrid control includes the steps S201 is to step S206, and this embodiment can be as the preferred embodiment of embodiment illustrated in fig. 6.
Step S201, with step S101 of embodiment illustrated in fig. 6, does not repeats them here.
Step S202, obtains the current data content in DataGrid control.
It should be noted that in embodiments of the present invention, if the row in DataGrid control is as a class, then go Each row be exactly an object in such, and the corresponding field in such of each row, so, current number Data content according to every a line that content is in DataGrid control.
Step S203, obtains the parent data content of current data content.
It should be noted that in embodiments of the present invention, if DataGrid control is as class, then data grids Every a line in control is exactly an object in such, and the corresponding field in such of every a line, so, Parent data content is the data content at DataGrid control place, can obtain the DataGrid control institute at row place Data content, row here can be null.
Step S204, is tied to the self-defining line width of parent data content of current data content by the width of container Attribute.
In embodiments of the present invention, the parent data content that the width of container is tied to current data content is self-defining Line width attribute, i.e. the width of container is tied to the DataGrid control self-defining line width attribute at row place, Wherein, container is the container of null, and the whether visible attribute of the row pattern of null corresponding to container be preset as can not Seeing, so, when loading data in this embodiment, the data being loaded do not appear in the corresponding positions of DataGrid control Putting, line width attribute includes the overall width of row set in advance, and this line width attribute is used for obtaining in DataGrid control The col width summation of all row, as such, it is possible to the DataGrid control that the width of null is tied to null place is self-defined Line width attribute on.In embodiments of the present invention, self-defining line width attribute obtains in the following manner: counting According to calculating total col width on the data content of Net Lattice Controls, specifically, when the col width of each row is equal, total col width etc. Col width and the product of columns in single row;When the col width of each row is unequal, total col width is equal to the col width of each row Cumulative sum;Total col width is assigned to self-defining line width attribute, i.e. can be by calculated total col width assignment To the preset value of line width in DataGrid control, wherein, the preset value of line width is line width attribute.
It should be noted that in embodiments of the present invention, can be only obtained from by step S202 or step S203 The line width attribute of definition, and without using step S202 and step S203 to belong to obtain self-defining line width simultaneously Property.
Step S205, obtains the col width summation of all row in DataGrid control by line width attribute.
In embodiments of the present invention, the overall width of the row in line width attribute is equal to the col width of all row in DataGrid control Summation.
Step S206, with step S103 of embodiment illustrated in fig. 6, does not repeats them here.
By the embodiment of the present invention, use the col width summation being tied in line width attribute by the overall width of null, it is achieved that The purpose that the col width summation of the overall width of null row all with DataGrid control is equal, has reached lucky display level Scroll bar is to check the effect of all column informations.
Fig. 8 is the display processing method of the HScrollBar for DataGrid control according to a third embodiment of the present invention Flow chart.
As shown in Figure 8, the display processing method of this HScrollBar being used for DataGrid control includes the steps S301 is to step S307, and this embodiment can be as the preferred embodiment of embodiment illustrated in fig. 6.
Step S301 is to step S302, respectively with step S101 of embodiment illustrated in fig. 6 to step S102, at this Repeat no more.
Step S303, it is judged that whether the data source of DataGrid control is empty.
It should be noted that before whether the data source judging DataGrid control is sky, can first obtain data Source, wherein, data source can include the form etc. that third-party agent, internet and user are imported by monitoring.Work as number When having data according to source, it is judged that be not empty for this data source, perform step S304A, otherwise when data source no data, It is judged as that this data source, for sky, performs step S304B.
Step S304A, does not processes.
If the data source of DataGrid control is not empty, do not process.In embodiments of the present invention, do not process Refer to DataGrid control not processed.
Step S304B, is set to the attribute that can the user of DataGrid control add newline very.
If the data source of DataGrid control is empty, then can the user of DataGrid control be added the attribute of newline Being set to true, so, DataGrid control will add a line null automatically.It should be noted that it is real in the present invention Executing in example, can add meaningless data in null, these meaningless data refer to any data, and due to The line sample attribute of null is invisible, and therefore, these the meaningless data in null do not appear in DataGrid control In.
Step S305, is entered as the line width of null by the line width of DataGrid control.
In embodiments of the present invention, the attribute that can the user of DataGrid control be added newline be set to true it After, the line width of DataGrid control is entered as the line width of null.
Step S306, loads data source for DataGrid control.
In embodiments of the present invention, data source refers to provide container or the original media of certain required data, i.e. Data source is the source of data, can be found the database at data place by data source.In embodiments of the present invention, Can be that DataGrid control is loaded with the data source of data and the data source of no data.
Step S307, with step S103 of embodiment illustrated in fig. 6, does not repeats them here.
As can be seen from the above description, by the present invention, the null obtained in DataGrid control is used;? When the data of DataGrid control are empty, obtain the col width summation of all row in DataGrid control by null;And Col width summation display HScrollBar according to row all in DataGrid control, solves in correlation technique at no data Time, DataGrid control cannot show that horizontal scroll bar, to check the problem of all of row, and then has reached not by data With presence or absence of limit and directly display HScrollBar to check the effect of all row in DataGrid control.
It should be noted that can be at such as one group of computer executable instructions in the step shown in the flow chart of accompanying drawing Computer system performs, and, although show logical order in flow charts, but in some cases, can With to be different from the step shown or described by order execution herein.
Obviously, those skilled in the art should be understood that each module of the above-mentioned present invention or each step can be with general Calculating device realize, they can concentrate on single calculating device, or is distributed in multiple calculating device institute On the network of composition, alternatively, they can realize with calculating the executable program code of device, it is thus possible to It is stored in storing in device and is performed by calculating device, or they are fabricated to respectively each integrated circuit die Block, or the multiple modules in them or step are fabricated to single integrated circuit module realize.So, the present invention It is not restricted to any specific hardware and software combine.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for the skill of this area For art personnel, the present invention can have various modifications and variations.All within the spirit and principles in the present invention, made Any modification, equivalent substitution and improvement etc., should be included within the scope of the present invention.

Claims (10)

1. the display processing method for the HScrollBar of DataGrid control, it is characterised in that including:
Obtaining the null in DataGrid control, wherein, there is institute when data are for sky in described DataGrid control Stating null, described null includes container, the overall width of described null and all row in described DataGrid control Col width summation consistent;
When data at described DataGrid control are empty, obtained in described DataGrid control by described null The col width summation of all row;And
Col width summation display HScrollBar according to row all in described DataGrid control.
The display processing method of the HScrollBar for DataGrid control the most according to claim 1, its feature It is, obtains the col width summation of all row in described DataGrid control by described null and include:
Obtain the current data content in described DataGrid control;
Obtain the parent data content of described current data content;
The width of described container is tied to the self-defining line width of parent data content of described current data content Attribute, described line width attribute is for obtaining the col width summation of all row in described DataGrid control;And
The col width summation of all row in described DataGrid control is obtained by described line width attribute.
The display processing method of the HScrollBar for DataGrid control the most according to claim 2, its feature Being, described self-defining line width attribute obtains in the following manner:
The data content at described DataGrid control place calculates total col width;And
Described total col width is assigned to described self-defining line width attribute.
The display processing method of the HScrollBar for DataGrid control the most according to claim 1, its feature It is, before the col width summation according to row all in described DataGrid control shows HScrollBar, described Display processing method also includes: load data source for described DataGrid control.
The display processing method of the HScrollBar for DataGrid control the most according to claim 4, its feature Being, before loading data source for described DataGrid control, described display processing method also includes:
Whether the data source judging described DataGrid control is empty;
If the data source of described DataGrid control is not empty, do not process;
If the data source of described DataGrid control is empty, then can the user of described DataGrid control be added The attribute adding newline is set to very;And
After the attribute that can the user of described DataGrid control add newline is set to very, by described number The line width of described null it is entered as according to the line width of Net Lattice Controls.
6. the display processing unit for the HScrollBar of DataGrid control, it is characterised in that including:
First acquiring unit, for obtaining the null in DataGrid control, wherein, described DataGrid control In data for there is described null time empty, described null includes container, the overall width of described null and described number Col width summation according to row all in Net Lattice Controls is consistent;
Second acquisition unit, for when the data of described DataGrid control are empty, obtaining by described null The col width summation of all row in described DataGrid control;And
Display unit, shows HScrollBar for the col width summation according to row all in described DataGrid control.
The display processing unit of the HScrollBar for DataGrid control the most according to claim 6, its feature Being, described second acquisition unit includes:
First acquisition module, for obtaining the current data content in described DataGrid control;
Second acquisition module, for obtaining the parent data content of described current data content;
Binding module, for being tied to the parent data content of described current data content by the width of described container Self-defining line width attribute, described line width attribute is for obtaining the row of all row in described DataGrid control Wide summation;And
3rd acquisition module, for obtaining the row of all row in described DataGrid control by described line width attribute Wide summation.
The display processing unit of the HScrollBar for DataGrid control the most according to claim 7, its feature Being, in order to obtain described self-defining line width attribute, described second acquisition unit also includes:
Computing module, for calculating total col width on the data content at described DataGrid control place;And
Assignment module, for being assigned to described self-defining line width attribute by described total col width.
The display processing unit of the HScrollBar for DataGrid control the most according to claim 6, its feature Being, described device also includes: loading unit, at the row according to row all in described DataGrid control Before wide summation display HScrollBar, load data source for described DataGrid control.
The display processing unit of the HScrollBar for DataGrid control the most according to claim 9, its feature Being, described device also includes:
Whether judging unit, be empty for judging the data source of described DataGrid control;
Processing unit, if the data source for described DataGrid control is not empty, does not processes;
Unit is set, if the data source for described DataGrid control is empty, then by described data grids control Can the user of part add the attribute of newline and be set to very;And
Assignment unit, for being set to very at the attribute that can the user of described DataGrid control add newline Afterwards, the line width of described DataGrid control is entered as the line width of described null.
CN201310541265.8A 2013-11-05 2013-11-05 The display processing method of HScrollBar and device for DataGrid control Active CN103577047B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310541265.8A CN103577047B (en) 2013-11-05 2013-11-05 The display processing method of HScrollBar and device for DataGrid control

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310541265.8A CN103577047B (en) 2013-11-05 2013-11-05 The display processing method of HScrollBar and device for DataGrid control

Publications (2)

Publication Number Publication Date
CN103577047A CN103577047A (en) 2014-02-12
CN103577047B true CN103577047B (en) 2016-08-17

Family

ID=50048942

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310541265.8A Active CN103577047B (en) 2013-11-05 2013-11-05 The display processing method of HScrollBar and device for DataGrid control

Country Status (1)

Country Link
CN (1) CN103577047B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104484203B (en) * 2014-12-11 2018-06-26 北京国双科技有限公司 For the method for exhibiting data and device of table data displaying control
WO2016187805A1 (en) * 2015-05-26 2016-12-01 华为技术有限公司 Data processing method and device
CN108073434B (en) * 2016-11-15 2021-02-09 深圳联友科技有限公司 JS drawing control method and system
CN112527178B (en) * 2020-12-16 2023-04-07 平安银行股份有限公司 Page control method, device, equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101065723A (en) * 2004-11-26 2007-10-31 菲利普·K·钦 Method of displaying data in a table

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100146434A1 (en) * 2008-12-09 2010-06-10 Yahoo!, Inc. Minimap Navigation for Spreadsheet
US20100162161A1 (en) * 2008-12-23 2010-06-24 Microsoft Corporation Smooth pixel-based scrolling in a user interface control

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101065723A (en) * 2004-11-26 2007-10-31 菲利普·K·钦 Method of displaying data in a table

Also Published As

Publication number Publication date
CN103577047A (en) 2014-02-12

Similar Documents

Publication Publication Date Title
CN103678631B (en) page rendering method and device
US20210409907A1 (en) Methods and devices for displaying a heat map and providing heat data
CN103577047B (en) The display processing method of HScrollBar and device for DataGrid control
CN107239566B (en) User journal generation method, electronic equipment and computer-readable storage medium
Ayat et al. Issues in implementing it governance in small and medium enterprises
WO2014026602A1 (en) A data processing method, apparatus and mobile terminal
CN112348954A (en) Building model processing method and device, computer equipment and storage medium
Cho et al. Time estimation method for manual assembly using MODAPTS technique in the product design stage
CN104199939A (en) Webpage thermodynamic diagram generating method and device
CN109885446A (en) Determine that Website page shows the method and device of state
CN106775394B (en) Content revealing method, device and electronic equipment, storage medium
CN104809751B (en) The method and apparatus for generating event group evolution diagram
CN103605716A (en) Data processing method and device used for webpage click display
CN105677658B (en) Page display method and device
CN106296622A (en) The pattern splicing method of a kind of autoplacement and device
CN108614762A (en) A kind of browser testing method and device
CN103309553B (en) The method and terminal of data amplification input
CN109460930B (en) Method for determining risk account and related equipment
CN105868246A (en) Picture display method and apparatus
CN106649350B (en) Method and device for acquiring position information of link element
CN106201551A (en) A kind of application program exits method and device
CN111598988B (en) D3-based method and system for rendering knowledge graph data nodes
CN113297313B (en) Table data display method and device, electronic equipment and storage medium
CN107967708A (en) Water wave simulation method and device
CN114117274A (en) Data rendering method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Display processing method and device for horizontal scroll bars of DataGrid control

Effective date of registration: 20190531

Granted publication date: 20160817

Pledgee: Shenzhen Black Horse World Investment Consulting Co.,Ltd.

Pledgor: BEIJING GRIDSUM TECHNOLOGY Co.,Ltd.

Registration number: 2019990000503

PE01 Entry into force of the registration of the contract for pledge of patent right
CP02 Change in the address of a patent holder

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Patentee after: BEIJING GRIDSUM TECHNOLOGY Co.,Ltd.

Address before: 100086 Beijing city Haidian District Shuangyushu Area No. 76 Zhichun Road cuigongfandian 8 layer A

Patentee before: BEIJING GRIDSUM TECHNOLOGY Co.,Ltd.

CP02 Change in the address of a patent holder
PP01 Preservation of patent right

Effective date of registration: 20240604

Granted publication date: 20160817