Data grid font fomating

Hi everyone,
I am trying to write some code that will allow me to set what
the font looks like in a data grid. The font is going to chagne
when a user chagnes something(i.e the user archives something i
want the whole row to be italized based of a certain value that is
set). How can this be done, and also in certain situations i only
want a certain cell to change(i.e something new was added by
another user i only want the first column in that row to be bold)
how would that work...
Thanks

yea while i was working with VB , i was using data grids that lists the records those came from the access database.
i'm using an access database again ,but with java codes i wanna do listing. im not making an applet, but a self GUI application, and dont know how to list the records. because in applets there's paint() method.in such an example of mine there's not.
what can i do? if there is no data grid or something alike in java for self GUI applications, how can i list them as a whole in a frame?
thanks

Similar Messages

  • Data display grid font selection

    Does anyone know how to change the font that's used on the "Data" tab when displaying the content of rows in a table?
    I'm trying to view chinese characters which are stored in UTF-8 unicode in the database. I have all the necessary fonts loaded on my machine and the correct NLS_LANG settings.
    I can see western characters, arabic, russian, greek OK in the data-grid, but not chinese or other far-eastern languages. Instead I see little squares instead of the symbols.
    I've checked for font setting in Tools -> Preferences but the only setting I can find is under the "Code Editor" section. This is set correctly (to Arial Unicode MS) and if I copy the "little squares" from the data grid and paste them into a code-edit tab I see the characters correctly displayed.
    So it seems that the "Font" setting for the code-edit tabs isn't used by the data-display tabs.
    Is there a way of making both code-editor window and data-display tab use the same font?

    i would create a standard report.
    i presume the air pressure and humidity are from one field? if not create a formula to display that.
    create groups
    1- a/p humidity field or formula
    2- time
    3- ref-measure- error
    not sure if they are the same field or different.
    you can then place your data in the groups (formulas calcs etc)
    then underlay the groups so they appear on the same line
    then draw boxes around them.
    hope this helps

  • How can change the font in the script output and the data grid ?

    How can change the font in the script output and the data grid in Sql Developer?

    You can't easily unless you have the latest version (2.1.1).
    If you do have this version then changing the font in the Tools/Preferences menu under the code editor/fonts section will also change the font of the data grid.
    For details of changing the fonts in an earlier version then see Sue's post below.
    http://sueharper.blogspot.com/2010/03/back-to-basics-changing-font-setting-in.html

  • Populating the data grid

    OK I think that is resolved but I cannot pull the Data.
    The Grid does not populate with data......Just keeps trying to pull it.
    THE CFC FUNCTION:
    <cffunction name="comments" access="remote" returntype="struct">
      <cfargument name="page" required="true">
      <cfargument name="pageSize" required="true">
      <cfargument name="gridsortcolumn" required="true">
      <cfargument name="gridsortdirection" required="true">
       <cfquery name="selectAll" datasource="#dsn#" dbtype="#i#">
        SELECT autoid, CONVERT(VARCHAR(10), sDate, 101) as sDATE, DAGRSN, branch,
          DODAAC, clin, hours
        FROM reporting.DAGRSCRAPS
       </cfquery>
      <cfreturn queryconvertforgrid(selectAll,page,pagesize)/>
    </cffunction>
    THE DATA GRID ITSELF:
    <cfform name="myform" id="myformid">
    <cfgrid
    name = "myGrid"
    format="html"
    bindOnLoad="yes"
    bind="cfc:pdgps.admin.backoffice.components.Data.comments({cfgridpage },{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})"
    pageSize="10"
    preservePageOnSort="true"
    selectMode="single"
    selectOnLoad="no"
    font="Verdana"
    fontsize="11"
    label="True"
    stripeRows="true"
    stripeRowColor="##D9CCFF"
    selectColor="##994FE6">
      <cfgridcolumn name="autoid" display="no" >
      <cfgridcolumn name="branch" header="SERVICE" type="string_noCase" >
      <cfgridcolumn name="DODAAC" header="DODAAC" type="string_noCase" >
      <cfgridcolumn name="DAGRSN" italic="yes" display="yes" header="DAGRSN">
      <cfgridcolumn name="sDATE" display="yes" header="Date" mask="EEE DD-MMM-YY H:NN A">
      <cfgridcolumn name="clin" width="35" display="yes" >
    </cfgrid>
    </cfform>

    <cfargument name="gridsortdirection" required="true">
    <cfset var selectAll = "">
    <!--- this 'var' scopes the selectAll variable to be local to this function --->
    <cfquery name="selectAll" datasource="#dsn#" dbtype="#i#">
    Also, where are the 'dsn' and 'i' variables defined.  They do not appear to be part of this function.  Using a CFC function remotely has a great effect on what variables scopes may or may not be accessed.

  • Text in data grids doesn't display

    With the new 29 version of FireFox, data grids on our site don't seem to display the data in the grids any longer. When using Chrome or IE11, these still show just fine. Version 28 and earlier worked great. The menu system in our site doesn't work well any longer either using version 29.
    What we are seeing on this site was also seen with IE11 when it first came out but that was easily fixed by just using the "compatability" settings in IE11 and adding our site to the list of compatible sites. There isn't such a setting in FireFox so I wonder how we go about getting around this.

    Thanks for the offer but we no part of this site can be publicly accessed. The thought of a font causing the problem doesn't make much sense to me because it was working fine prior to version 29. Why would the font all of a sudden be causing the problem. Furthermore, it isn't just text in data grids but the menu system we use doesn't work properly either. You have to hold down on the left mouse button to use the menu and then when you are on the item you want to select, let off the left mouse button. Guess our only option is to start recommending Chrome or IE.

  • How to save xml and xsl function to a data grid column

    hi. wondering, i have a xml and a xsl file, and have the transform class, and so need to save the xml and the xsl file, and display the results on a particular data grid column and to loop through the data grid columns. so, how do i use the xml save function
    class, any examples or point me to articles, where i can read how to do this. need to display a file, with a different colour and font. any ideas. thanks. marvin.hi. need to save a xml and xsl file and display the results on data grid. how do i do this. any
    sample code or articles i can read about thanks. marvin.
    http://startrekcafe.stevesdomain.net http://groups.yahoo.com/groups/JawsOz

    
    Hi.
    Okay, well, did ask on the msdn forums, and some one replied, and so, will paste the code he suggested.
    But getting a lot of errors.
    Can you help me out.
    Where am I going wrong.
    So, I can then get this to work, then it shows the colours and the fonts on the specified data grid.
    Can you help.
    Want to get this working and passed today if possible.
    Will pasate the code and the errors below.
    Can you help.
    Where am I going wrong.
    Marvin.
    // Set up the data set.
    DataSet ds =
    new
    DataSet();
    // Set up the data table.
    DataTable dt =
    new
    DataTable();
    // Ad the data table to the data set.
        ds.Tables.Add(dt);
    // Write the xml document to the data grid column.
        ds.WriteXML(@"c:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\CurrentCount.xml");
        ds.WriteXML(@"c:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\OnOrder.xml");
        ds.ReadXML(@"c:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\CurrentCount.xml");
        ds.ReadXML(@"c:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\OnOrder.xml");
    // Set up the data table and the data set and set to 0.
        dgvDisplayData.DataSource = ds.Tables[0];
    Error      1              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                215        
    18           WoodStocks
    Error      2              Invalid token ')' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                215        
    21           WoodStocks
    Error      3              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                219        
    16           WoodStocks
    Error      4              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                221        
    16           WoodStocks
    Error      5              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                222        
    15           WoodStocks
    Error      6              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                223        
    15           WoodStocks
    Error      7              Invalid token '=' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                227        
    31           WoodStocks
    Error      8              Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                227        
    43           WoodStocks
    Error      9              Invalid token ';' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                227        
    45           WoodStocks
    Can you help me out.
    Thanks.
    http://startrekcafe.stevesdomain.net http://groups.yahoo.com/groups/JawsOz

  • Ah! the delights of advanced data grid!

    I have a xml hierarchical advanced data grid.
    Is there a way to disable the folderIcons for the advanceddatagrid?
    Or is there a way to integrate the folderIcon actions to selected row actions?
    Right now, I have a listener for itemOpen. When one folder opens, then another one will close. However, when the user clicks on the folderIcon....it does not do this. I do not know how to access the expandeditem of the advanceddatagrid.
    Thank you for your help!
    Emma
    * Also, the fonts are being embedded by css...when you click on the folder...the fonts jump while they are being propagated. suggestions?

    That is a great idea...except I am using the selectRow to use these same events.
    It seems what I need is access to the same selectedItem.
    When I click on the row, I pass through _selectedItem from the event function.
    However, it is a little bit more complicated for the drop down buttons.
    I try to get the same format with this:
    selectedItem=IHierarchicalCollectionView(adg.dataProvider).openNodes;
    but I get an [object][object]
    I found this bit of code on a site:
    import mx.collections.HierarchicalCollectionView;
    myOpenNodes:Array = new Array(); 
    var HierColView:HierarchicalCollectionView = HierarchicalCollectionView(myADG.dataProvider);
    for each ( var item:Object in HierColView.openNodes ) {
    myOpenNodes.push(item);
    myADG.dataProvider.openNodes = myOpenNodes;

  • Data grid hidden

    hi. okay, have a two click buttons, and they are supposed to write to the xml and read the xml file, and then transform it to the application, when i click on the Current count or On Order buttons, when you click these buttons, have a grey background colour,
    foreground blue colour, and have a different font of Verdana and Century School book. it keeps  hidden, when i click these buttons, when i load the data grid from the csv. so, how do i make sure that, it is not hidden, when i click on it. will paste the
    two button click events. have tried googling this, and did not find any thing. so will paste the code below.
    marvin.
            // This function will display the Current Count data grid column  to change the style sheet for this click event.
            private void btnCurrentCount_Click(object sender, EventArgs e)
          // Design a data table and write and read the xml documents to the data grid columns selected.
          // Set up the data set.
          DataSet ds = new DataSet();
          // Set up the data table.
          DataTable dt = new DataTable();
          // Ad the data table to the data set.
          ds.Tables.Add(dt);
          // Write the xml document to the data grid column.
          ds.WriteXml(Application.StartupPath + ("CurrentCount.xml"));
          ds.ReadXml(Application.StartupPath + ("CurrentCount.xml"));
                // Set up the data table and the data set and set to 0.
          dgvDisplayData.DataSource = ds.Tables[0];
              // Set focus on the Data Grid Column.
          dgvDisplayData.Focus();
          System.Xml.Xsl.XslCompiledTransform xslTransformer =new System.Xml.Xsl.XslCompiledTransform();
          xslTransformer.Load("CurrentCount.xsl");
          xslTransformer.Transform("CurrentCount.xml", "CurrentCount.html");
        // This function will display the  On Order data grid column  to change the style sheet for this click event.
        private void btnOnOrder_Click(object sender, EventArgs e)
          // Design a data table and write and read the xml documents to the data grid columns selected.
          // Set up the data set.
          DataSet ds = new DataSet();
          // Set up the data table.
          DataTable dt = new DataTable();
          // Ad the data table to the data set.
          ds.Tables.Add(dt);
          // Write the xml document to the data grid column.
          ds.WriteXml(Application.StartupPath + ("OnOrder.xml"));
          ds.ReadXml(Application.StartupPath + ("OnOrder.xml"));
          // Set focus on the Data Grid Column.
          dgvDisplayData.Focus();
                System.Xml.Xsl.XslCompiledTransform xslTransformer = new System.Xml.Xsl.XslCompiledTransform();
          xslTransformer.Load("OnOrder.xsl");
          xslTransformer.Transform("OnOrder.xml", "OnOrder.html");
    http://startrekcafe.stevesdomain.net http://groups.yahoo.com/groups/JawsOz

    Hello,
    Perhaps you can show what you are after by posting images and describe from the images what you want as I am unclear otherwise to what you are after, thanks.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my webpage under my profile
    but do not reply to forum questions.

  • Difference between Data Grid and Data Forms

    Hi all,
    What is the difference between data grid and data forms.

    Data entry forms are pre defined and are generally used to manually input data into reporting (financial statement) schedules.
    They can also be used for reviewing purposes and it gives users a presentable / and consistent format to view data in Hyperion.
    Data grids are the equivalent of pivot tables in excel. It should be used for ad hoc purposes to view / analyse data in whatever form you choose. The user has the flexibility to choose what they see in the rows, columns and page dimensions.
    One of the main differences between data entry forms and data grids is that you can’t export data grids to excel whereas you can with data entry forms. Other differences are:
    1. Run consolidation, translation, promotion from data grids but not in data entry forms.
    2. You can link other data entry forms to a data entry form
    3. Data entry forms offer greater formatting options than in data grids i.e. colours, fonts, bold, italics.
    At the end of the day, they are similar and there is no reason why you can’t have (use) both. It all depends on your local needs on how best you use both.
    I hope above information helps.

  • Display value in data grid

    08/29/2008 08:58:48 AM
    Reply | Quote | Top | Bottom | Edit
    hi all,
    i have two classes.
    class User
    public String name;
    public int age;
    public Address address;
    class Address
    public String city;
    I'm passing a List<Users> to the data provider of a
    data grid . I can display the values of properties of Users i.e,
    name and age.. My issue is how do i display the value of city which
    is a propertyt of Address class in the datagrid column..
    thanx in advance
    Mark this message as the answer.
    Print this message
    Report this to a Moderator

    Hi,
    Try labelFunction property of the DataGridColumn.
    labelFunction allow you to specify a function name, which will be
    invoked when that data is rendered. You will get the Object (User
    id your case) corresponding the row being rendered will be passed
    as argument to the function. You can use the object and return the
    value you want to be displayed.
    Please find more details on labelFunction at the URL below
    http://livedocs.adobe.com/flex/3/langref/mx/controls/dataGridClasses/DataGridColumn.html#l abelFunction
    You can also try custom item renderer.
    Hope this helps.

  • Can not open data grids or run reports in HFM

    Hi
    We created an application and have been working in it for weeks without any issues. Just recently once we open the app, we can longer open data grids or run financial grids. The system just hangs and we do not get an error message. Has anyone experienced this? We are wondering if it is a space issue on one of the data base tables.

    Hello,
    I would start by checking with your DBA to see if you have any issues with table space. Next, i would log onto the HFM servers and see if you have any errors being recorded in the Application Event View. If you do have errors in your Event Viewer, can you please post them?
    Thanks
    Edited by: tonyfeole on Oct 13, 2009 1:33 PM

  • FillBy always fills in the same row in data grid view. How to make it fill in a new row for each click of the Fillby Button? VB 2010 EXPRESS?

    Hi there, 
    I am a beginner in Visual Basic Express 2010. I have a Point of Sale program that uses DataGridView to display records from an external microsoft access
    database using the fillby query. 
    It works, but it repopulates the same row each time, but i want to be able to display multiple records at the same time, a new row should be filled for
    each click of the fillby button. 
    also I want to be able to delete any records if the customer suddenly decides to not buy an item after it has already been entered. 
    so actually 2 questions here: 
    1. how to populate a new row for each click of the fillby button 
    2. how to delete records from data grid view after an item has been entered 
    Thanks 
    Vishwas

    Hello,
    The FillBy method loads data according to what the results are from the SELECT statement, so if there is one row then you get one row in the DataGridView, have two rows then two rows show up.
    Some examples
    Form load populates our dataset with all data as it was defined with a plain SELECT statement. Button1 loads via a query I created after the fact to filter on a column, the next button adds a new row to the existing data. When adding a new row it is appended
    to the current data displayed and the primary key is a negative value but the new key is shown after pressing the save button on the BindingNavigator or there are other ways to get the new key by manually adding the row to the backend table bypassing the Adapter.
    The following article with code shows this but does not address adapters.
    Conceptually speaking the code in the second code block shows how to get the new key
    Public Class Form1
    Private Sub StudentsBindingNavigatorSaveItem_Click(
    sender As Object, e As EventArgs) Handles StudentsBindingNavigatorSaveItem.Click
    Me.Validate()
    Me.StudentsBindingSource.EndEdit()
    Me.TableAdapterManager.UpdateAll(Me.MyDataSet)
    End Sub
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    'TODO: This line of code loads data into the 'MyDataSet.Students' table. You can move, or remove it, as needed.
    Me.StudentsTableAdapter.Fill(Me.MyDataSet.Students)
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Me.StudentsTableAdapter.FillBy(Me.MyDataSet.Students, ComboBox1.Text)
    End Sub
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    Me.MyDataSet.Students.AddStudentsRow("Jane", "Adams", "Female")
    End Sub
    End Class
    Get new key taken from
    this article.
    Public Function AddNewRow(ByVal sender As Customer, ByRef Identfier As Integer) As Boolean
    Dim Success As Boolean = True
    Try
    Using cn As New OleDb.OleDbConnection With {.ConnectionString = Builder.ConnectionString}
    Using cmd As New OleDb.OleDbCommand With {.Connection = cn}
    cmd.CommandText = InsertStatement
    cmd.Parameters.AddWithValue("@CompanyName", sender.CompanyName)
    cmd.Parameters.AddWithValue("@ContactName", sender.ContactName)
    cmd.Parameters.AddWithValue("@ContactTitle", sender.ContactTitle)
    cn.Open()
    cmd.ExecuteNonQuery()
    cmd.CommandText = "Select @@Identity"
    Identfier = CInt(cmd.ExecuteScalar)
    End Using
    End Using
    Catch ex As Exception
    Success = False
    End Try
    Return Success
    End Function
    In closing I have not given you a solution but hopefully given you some stuff/logic to assist with this issue, if not perhaps I missed what you want conceptually speaking.
    Additional resources
    http://msdn.microsoft.com/en-us/library/fxsa23t6.aspx
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • Coded UI: How to verify watermark displayed in the fields and Data grid?

    Hi,
    I've an requirement to verify watermark in the fields say username field displays "Username" water mark when no data is available in the field and water mark in data grid saying "No data available".
    Please observe the water mark displayed in screenshot below:
    So how to verify watermark?
    Thanks & Regards,
    Sunil
    Best Regards, Sunil Email: [email protected]

    Hello,
    Depending on what form technology you are using, you can try posting to one of the following forums:
    Windows Forms General
    Windows Presentation Foundation (WPF)
    ASP.Net forums
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Want Access Data Grid control in SharePoint 2013?

    Hello everyone!
    Recently we noticed something funny in SharePoint 2013. While quite many people were hoping to have the datasheet view like those in SP2007 and 2010, Microsoft has chosen a different interface to display datasheet view.
    Now, if you try to create a sub site under a publishing site, and use the
    Publishing Site template then try to create a datasheet view in the sub site, SharePoint will try to use the Access data grid control to display the view. In some situations the view will display and other situations it will not, and will show this
    error:
    The list is displayed in Standard view. It cannot be displayed in Datasheet view for one or more of the following reasons: A datasheet component compatible with Microsoft SharePoint Foundation is not installed, your browser does not support ActiveX controls,
    a component is not properly configured for 32-bit or 64-bit support, or support for ActiveX controls is disabled.
    If you create a sub site using Publishing Site with Workflow instead, then the datasheet view will be created properly using SP2013 interface.
    Using PowerShell, we can see that both Publishing Portal and
    Publishing Site With Workflow are using the BLANKINTERNET 53 template. The
    Publishing Site on the other hand is using the CMSPUBLISHING 39 template.
    Want to try it out and let me know if that happens to your SharePoint too?

    Hi Conway,
    I tested the issue in my environment per your description and it returned the results as below:
    I created a subsite using Publishing site under a team site in SharePoint server 2013, the datasheet view in a list displayed as pic1
    I reproduced the issue in SharePoint server 2010, the datasheet view in a list displayed as pic2
    It turns out by design the datasheet view in the subsite based on Publishing site template displays as your situation. Here is an article which explains this:
    http://www.sharepointblues.com/2010/03/31/data-sheet-view-not-working/
    Regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected] .
    Rebecca Tu
    TechNet Community Support

  • Problem in Data Grid

    Hi All,
    Account calculations are not displaying on the data grid. But the values are being picked up with a smart view report.
    I tried running a force calculate and a consolidate all, but that did not work.
    Please suggest in this regards.
    Thanks in advance....

    I tried to use your algorithm to modify my code but i am not able to do that. For this example i am not using any httpservice i am  using data services. I created a PHP file i just need to import it into data services planel and drag that services onto data grid it will automatically bring all the data into that data grid.  Can you tell me what i need to modify to achive my goal. am using following code
    protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
    getHorizontalCommentResult.token = horizontalCommentsService.getHorizontalComment();
    <mx:DataGrid x="159" y="123" id="dataGrid" creationComplete="dataGrid_creationCompleteHandler(event)" dataProvider="{getHorizontalCommentResult.lastResult}" height="223" width="245">
    <mx:columns>
    <mx:DataGridColumn headerText="Comments" dataField="Comments"/>
    </mx:columns>
    PP file
    <?php
    class HorizontalCommentsService{
    public function getHorizontalComment() {
    $connection = mysqli_connect("localhost", "root", "root", "my_db", 8889) or die(mysqli_connect_error());
    $sql = "SELECT * FROM photo_comments ORDER BY Image_ID DESC";
    $result = mysqli_query($connection, $sql) or die('Query Failed: ' . mysql_error($connection));
    $rows = array();
    while($row = mysqli_fetch_object($result)) {
    $rows[ ] = $row;
    return $rows;
    ?>

Maybe you are looking for